@sdcorejs/angular 22.3.3 → 22.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs +5 -5
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-import-excel.mjs +1 -1
- package/fesm2022/sdcorejs-angular-components-import-excel.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-modal.mjs +46 -10
- package/fesm2022/sdcorejs-angular-components-modal.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs +549 -82
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-table.mjs +6528 -3510
- package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs +1 -1
- package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-select.mjs +23 -4
- package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-tree-select.mjs +1 -1
- package/fesm2022/sdcorejs-angular-forms-tree-select.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-i18n.mjs +330 -5
- package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-layout.mjs +97 -11
- package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-base-api.service-Cfmr0L_5.mjs → sdcorejs-angular-modules-pattern-base-api.service-C2o5xPVB.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-base-api.service-Cfmr0L_5.mjs.map → sdcorejs-angular-modules-pattern-base-api.service-C2o5xPVB.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-create-side-drawer.component-CxgmaNod.mjs → sdcorejs-angular-modules-pattern-create-side-drawer.component-CRc9T7rb.mjs} +18 -4
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-CRc9T7rb.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-create-side-drawer.component-C7-itJqB.mjs → sdcorejs-angular-modules-pattern-create-side-drawer.component-Cz-MjRG0.mjs} +18 -4
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-Cz-MjRG0.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-create.component-C2GdGhkJ.mjs → sdcorejs-angular-modules-pattern-create.component-CxicczH7.mjs} +19 -5
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-CxicczH7.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-create.component-DIivNX4o.mjs → sdcorejs-angular-modules-pattern-create.component-D3MzNJ3F.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-create.component-DIivNX4o.mjs.map → sdcorejs-angular-modules-pattern-create.component-D3MzNJ3F.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-create.component-CzJh4LMR.mjs → sdcorejs-angular-modules-pattern-create.component-RBvVv88D.mjs} +36 -12
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-RBvVv88D.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-customer.service-B0nhFd_M.mjs → sdcorejs-angular-modules-pattern-customer.service-3hWkJClX.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-customer.service-B0nhFd_M.mjs.map → sdcorejs-angular-modules-pattern-customer.service-3hWkJClX.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-detail-side-drawer.component-D1dqsKX0.mjs → sdcorejs-angular-modules-pattern-detail-side-drawer.component-DzDAX3B7.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-detail-side-drawer.component-D1dqsKX0.mjs.map → sdcorejs-angular-modules-pattern-detail-side-drawer.component-DzDAX3B7.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-detail.component-WK0AcxNJ.mjs → sdcorejs-angular-modules-pattern-detail.component-CEhbU12j.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-detail.component-WK0AcxNJ.mjs.map → sdcorejs-angular-modules-pattern-detail.component-CEhbU12j.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-detail.component-Dkmm0a2Y.mjs → sdcorejs-angular-modules-pattern-detail.component-CcpYULut.mjs} +28 -11
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CcpYULut.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-flow.component-BvhEMUgY.mjs → sdcorejs-angular-modules-pattern-flow.component-G5lHfG81.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-flow.component-BvhEMUgY.mjs.map → sdcorejs-angular-modules-pattern-flow.component-G5lHfG81.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-general-information-form.component-cxNRkeRU.mjs → sdcorejs-angular-modules-pattern-general-information-form.component-BJaYcNzf.mjs} +3 -3
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-BJaYcNzf.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-index.component-D1zWXyN6.mjs → sdcorejs-angular-modules-pattern-index.component-CosbQK0W.mjs} +4 -4
- package/fesm2022/sdcorejs-angular-modules-pattern-index.component-CosbQK0W.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-lines-table-form.component-DmmVKrgM.mjs +836 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-lines-table-form.component-DmmVKrgM.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-CaXgC8wK.mjs → sdcorejs-angular-modules-pattern-list.component-BjehcQEk.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-CaXgC8wK.mjs.map → sdcorejs-angular-modules-pattern-list.component-BjehcQEk.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-1Xn1WaAP.mjs → sdcorejs-angular-modules-pattern-list.component-CNVqk3JC.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-1Xn1WaAP.mjs.map → sdcorejs-angular-modules-pattern-list.component-CNVqk3JC.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-Bv_l7vnz.mjs → sdcorejs-angular-modules-pattern-list.component-C_pVqRcC.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-Bv_l7vnz.mjs.map → sdcorejs-angular-modules-pattern-list.component-C_pVqRcC.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-ChwTb4BU.mjs → sdcorejs-angular-modules-pattern-list.component-EaNDEtCn.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-ChwTb4BU.mjs.map → sdcorejs-angular-modules-pattern-list.component-EaNDEtCn.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-B6Ndq542.mjs → sdcorejs-angular-modules-pattern-list.component-jB3E20UF.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-B6Ndq542.mjs.map → sdcorejs-angular-modules-pattern-list.component-jB3E20UF.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-mock-backend.factory-DKK3NmbN.mjs → sdcorejs-angular-modules-pattern-mock-backend.factory-CFljqhjv.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-mock-backend.factory-DKK3NmbN.mjs.map → sdcorejs-angular-modules-pattern-mock-backend.factory-CFljqhjv.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-pattern-source-viewer-BpLQaYP5.mjs → sdcorejs-angular-modules-pattern-pattern-source-viewer-BqHwKfoc.mjs} +9 -2
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source-viewer-BqHwKfoc.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-pattern-source.generated-BrejHvB2.mjs → sdcorejs-angular-modules-pattern-pattern-source.generated-CIiLOizq.mjs} +21 -19
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source.generated-CIiLOizq.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-product.service-GSlXwL2Z.mjs → sdcorejs-angular-modules-pattern-product.service-DitXmlr1.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-product.service-GSlXwL2Z.mjs.map → sdcorejs-angular-modules-pattern-product.service-DitXmlr1.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-profile.component-DPBwMafn.mjs → sdcorejs-angular-modules-pattern-profile.component-Dxw7Ix9d.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-profile.component-DPBwMafn.mjs.map → sdcorejs-angular-modules-pattern-profile.component-Dxw7Ix9d.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-B6z9lJYB.mjs → sdcorejs-angular-modules-pattern-routes-BOiWZHqg.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-B6z9lJYB.mjs.map → sdcorejs-angular-modules-pattern-routes-BOiWZHqg.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-h66efEeH.mjs → sdcorejs-angular-modules-pattern-routes-BWZxOMhB.mjs} +7 -7
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-h66efEeH.mjs.map → sdcorejs-angular-modules-pattern-routes-BWZxOMhB.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-DeThmv4f.mjs → sdcorejs-angular-modules-pattern-routes-BxXgJVsW.mjs} +4 -4
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-DeThmv4f.mjs.map → sdcorejs-angular-modules-pattern-routes-BxXgJVsW.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-t3O2L2J5.mjs → sdcorejs-angular-modules-pattern-routes-C43Q4Wtq.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-t3O2L2J5.mjs.map → sdcorejs-angular-modules-pattern-routes-C43Q4Wtq.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-D1fsRfRB.mjs → sdcorejs-angular-modules-pattern-routes-CJ-RAMa5.mjs} +5 -5
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-D1fsRfRB.mjs.map → sdcorejs-angular-modules-pattern-routes-CJ-RAMa5.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-DdCFCwxY.mjs → sdcorejs-angular-modules-pattern-routes-CWixJ2If.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-DdCFCwxY.mjs.map → sdcorejs-angular-modules-pattern-routes-CWixJ2If.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-1kifjm82.mjs → sdcorejs-angular-modules-pattern-routes-CophQH_L.mjs} +5 -5
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-1kifjm82.mjs.map → sdcorejs-angular-modules-pattern-routes-CophQH_L.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-bQpdxKlY.mjs → sdcorejs-angular-modules-pattern-routes-w4VY9P_H.mjs} +9 -9
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-bQpdxKlY.mjs.map → sdcorejs-angular-modules-pattern-routes-w4VY9P_H.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-B6w4N6wo.mjs → sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-BQCWgQsr.mjs} +12 -12
- package/fesm2022/{sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-B6w4N6wo.mjs.map → sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-BQCWgQsr.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-shell.component-BIYHlzVQ.mjs → sdcorejs-angular-modules-pattern-shell.component-BOjJteMd.mjs} +4 -4
- package/fesm2022/{sdcorejs-angular-modules-pattern-shell.component-BIYHlzVQ.mjs.map → sdcorejs-angular-modules-pattern-shell.component-BOjJteMd.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-update-side-drawer.component-nnldn2cz.mjs → sdcorejs-angular-modules-pattern-update-side-drawer.component-BT2PzXTG.mjs} +4 -4
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-BT2PzXTG.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-update-side-drawer.component-DKgmhJT2.mjs → sdcorejs-angular-modules-pattern-update-side-drawer.component-qmGn2tCI.mjs} +4 -4
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-qmGn2tCI.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-update.component-p9R5-eou.mjs → sdcorejs-angular-modules-pattern-update.component-CS3jlV-R.mjs} +5 -5
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-CS3jlV-R.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-update.component-C0Bewuwz.mjs → sdcorejs-angular-modules-pattern-update.component-CUgQPcR4.mjs} +22 -12
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-CUgQPcR4.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-update.component-Qlh3Lm2p.mjs → sdcorejs-angular-modules-pattern-update.component-lGwicZKW.mjs} +12 -10
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-lGwicZKW.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern.mjs +1 -1
- package/fesm2022/sdcorejs-angular-services-api.mjs +11 -11
- package/fesm2022/sdcorejs-angular-services-api.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-cache.mjs +7 -5
- package/fesm2022/sdcorejs-angular-services-cache.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-excel.mjs +34 -0
- package/fesm2022/sdcorejs-angular-services-excel.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-storage.mjs +6 -4
- package/fesm2022/sdcorejs-angular-services-storage.mjs.map +1 -1
- package/modules/pattern/docs/drawer.md +1 -1
- package/modules/pattern/docs/form.md +445 -148
- package/modules/pattern/docs/header-actions.md +14 -12
- package/modules/pattern/docs/select.md +9 -1
- package/modules/pattern/features/category/components/create-side-drawer/create-side-drawer.component.ts +8 -1
- package/modules/pattern/features/category/components/update-side-drawer/update-side-drawer.component.ts +1 -1
- package/modules/pattern/features/customer/components/create-side-drawer/create-side-drawer.component.ts +8 -1
- package/modules/pattern/features/customer/components/update-side-drawer/update-side-drawer.component.ts +1 -1
- package/modules/pattern/features/order/components/general-information-form/general-information-form.component.ts +1 -1
- package/modules/pattern/features/order/components/lines-form/lines-form.component.ts +124 -147
- package/modules/pattern/features/order/components/lines-form/order-lines.ts +101 -0
- package/modules/pattern/features/order/components/lines-table-form/lines-table-form.component.ts +196 -0
- package/modules/pattern/features/order/pages/create/create.component.ts +18 -4
- package/modules/pattern/features/order/pages/detail/detail.component.ts +14 -12
- package/modules/pattern/features/order/pages/update/update.component.ts +11 -4
- package/modules/pattern/features/product/components/general-information-form/general-information-form.component.ts +1 -1
- package/modules/pattern/features/product/components/product-select/product-select.component.ts +9 -1
- package/modules/pattern/features/product/pages/create/create.component.ts +8 -1
- package/modules/pattern/features/product/pages/update/update.component.ts +1 -1
- package/modules/pattern/features/settings/pages/update/update.component.ts +5 -4
- package/package.json +1 -1
- package/types/sdcorejs-angular-components-modal.d.ts +6 -1
- package/types/sdcorejs-angular-components-query-bar.d.ts +154 -13
- package/types/sdcorejs-angular-components-table.d.ts +448 -29
- package/types/sdcorejs-angular-i18n.d.ts +66 -1
- package/types/sdcorejs-angular-services-api.d.ts +5 -5
- package/types/sdcorejs-angular-services-cache.d.ts +4 -2
- package/types/sdcorejs-angular-services-excel.d.ts +59 -0
- package/types/sdcorejs-angular-services-storage.d.ts +3 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-C7-itJqB.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-CxgmaNod.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-C2GdGhkJ.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-CzJh4LMR.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-Dkmm0a2Y.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-cxNRkeRU.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-index.component-D1zWXyN6.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-lines-form.component-BK__9Mzb.mjs +0 -541
- package/fesm2022/sdcorejs-angular-modules-pattern-lines-form.component-BK__9Mzb.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source-viewer-BpLQaYP5.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source.generated-BrejHvB2.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-DKgmhJT2.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-nnldn2cz.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-C0Bewuwz.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-Qlh3Lm2p.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-p9R5-eou.mjs.map +0 -1
|
@@ -1,541 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, input, booleanAttribute, model, ChangeDetectionStrategy, Component, signal, computed, DestroyRef, effect, untracked } from '@angular/core';
|
|
3
|
-
import { SdSection } from '@sdcorejs/angular/components/section';
|
|
4
|
-
import { SdSelect } from '@sdcorejs/angular/forms/select';
|
|
5
|
-
import { firstValueFrom } from 'rxjs';
|
|
6
|
-
import { SdAvatar } from '@sdcorejs/angular/components/avatar';
|
|
7
|
-
import { SdItemDefDefDirective } from '@sdcorejs/angular/forms/directives';
|
|
8
|
-
import { C as CustomerService } from './sdcorejs-angular-modules-pattern-customer.service-B0nhFd_M.mjs';
|
|
9
|
-
import { c as ORDER_PAYMENTS, d as ORDER_WAREHOUSES, a as ORDER_CHANNELS } from './sdcorejs-angular-modules-pattern-routes-bQpdxKlY.mjs';
|
|
10
|
-
import { FormArray, FormGroup } from '@angular/forms';
|
|
11
|
-
import { SdButton } from '@sdcorejs/angular/components/button';
|
|
12
|
-
import { SdInputNumber } from '@sdcorejs/angular/forms/input-number';
|
|
13
|
-
import { SdFormatNumberPipe } from '@sdcorejs/angular/pipes';
|
|
14
|
-
import { P as ProductService } from './sdcorejs-angular-modules-pattern-product.service-GSlXwL2Z.mjs';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Chọn khách hàng cho màn khác (đơn hàng). Lựa chọn mới chỉ gồm khách đang hoạt động; giá trị đã chọn tải theo ID
|
|
18
|
-
* (`VALUE`) nên khách đã ngừng vẫn hiện khi cập nhật. Option hai dòng có avatar: tên · mã · điện thoại.
|
|
19
|
-
*/
|
|
20
|
-
class CustomerSelectComponent {
|
|
21
|
-
#customerService = inject(CustomerService);
|
|
22
|
-
form = input(/* @ts-ignore */
|
|
23
|
-
...(ngDevMode ? [undefined, { debugName: "form" }] : /* istanbul ignore next */ []));
|
|
24
|
-
name = input('customerId', /* @ts-ignore */
|
|
25
|
-
...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
26
|
-
label = input('Khách hàng', /* @ts-ignore */
|
|
27
|
-
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
28
|
-
required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
29
|
-
autoId = input(/* @ts-ignore */
|
|
30
|
-
...(ngDevMode ? [undefined, { debugName: "autoId" }] : /* istanbul ignore next */ []));
|
|
31
|
-
model = model(/* @ts-ignore */
|
|
32
|
-
...(ngDevMode ? [undefined, { debugName: "model" }] : /* istanbul ignore next */ []));
|
|
33
|
-
search = async (req) => {
|
|
34
|
-
if (req.type === 'VALUE') {
|
|
35
|
-
const ids = (Array.isArray(req.value) ? req.value : [req.value]).filter((id) => !!id);
|
|
36
|
-
return Promise.all(ids.map(id => firstValueFrom(this.#customerService.cachedDetail(id))));
|
|
37
|
-
}
|
|
38
|
-
const filters = [{ field: 'status', operator: 'EQUAL', data: 'active' }];
|
|
39
|
-
if (req.searchText) {
|
|
40
|
-
filters.push({
|
|
41
|
-
operator: 'OR',
|
|
42
|
-
data: [
|
|
43
|
-
{ field: 'name', operator: 'CONTAIN', data: req.searchText },
|
|
44
|
-
{ field: 'code', operator: 'CONTAIN', data: req.searchText },
|
|
45
|
-
{ field: 'phone', operator: 'CONTAIN', data: req.searchText },
|
|
46
|
-
],
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
const res = await firstValueFrom(this.#customerService.list({ pageNumber: 0, pageSize: 20, filters }));
|
|
50
|
-
return res.items;
|
|
51
|
-
};
|
|
52
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: CustomerSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
53
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.5", type: CustomerSelectComponent, isStandalone: true, selector: "customer-select", inputs: { form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { model: "modelChange" }, ngImport: i0, template: `<sd-select
|
|
54
|
-
[label]="label()"
|
|
55
|
-
[name]="name()"
|
|
56
|
-
[form]="form()"
|
|
57
|
-
[(model)]="model"
|
|
58
|
-
[items]="search"
|
|
59
|
-
valueField="id"
|
|
60
|
-
displayField="name"
|
|
61
|
-
[required]="required()"
|
|
62
|
-
[autoId]="autoId()">
|
|
63
|
-
<ng-template sdItemDef let-item="item">
|
|
64
|
-
<div class="d-flex align-items-center gap-8">
|
|
65
|
-
<sd-avatar [src]="null" [name]="item.name" [size]="28" />
|
|
66
|
-
<div class="d-flex flex-column">
|
|
67
|
-
<span>{{ item.name }}</span>
|
|
68
|
-
<small class="text-secondary"
|
|
69
|
-
>{{ item.code }} · {{ item.phone }}{{ item.status === 'inactive' ? ' · Ngừng hoạt động' : '' }}</small
|
|
70
|
-
>
|
|
71
|
-
</div>
|
|
72
|
-
</div>
|
|
73
|
-
</ng-template>
|
|
74
|
-
</sd-select>`, isInline: true, dependencies: [{ kind: "component", type: SdSelect, selector: "sd-select", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "valueField", "displayField", "disabledField", "cacheChecksum", "limit", "virtualScroll", "itemSize", "hyperlink", "minWidthPanel", "hideInlineError", "hideReadError", "required", "disabled", "viewed", "multiple", "showSelectAll", "clearable", "validator", "inlineError", "appearance", "floatLabel", "labelPlacement", "items", "model"], outputs: ["operatorChange", "sdReadStateChange", "modelChange", "sdChange", "sdSelection"] }, { kind: "directive", type: SdItemDefDefDirective, selector: "[sdItemDef]" }, { kind: "component", type: SdAvatar, selector: "sd-avatar", inputs: ["src", "size", "name", "status", "statusLabel", "statusPulse", "tooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
75
|
-
}
|
|
76
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: CustomerSelectComponent, decorators: [{
|
|
77
|
-
type: Component,
|
|
78
|
-
args: [{
|
|
79
|
-
selector: 'customer-select',
|
|
80
|
-
standalone: true,
|
|
81
|
-
imports: [SdSelect, SdItemDefDefDirective, SdAvatar],
|
|
82
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
83
|
-
template: `<sd-select
|
|
84
|
-
[label]="label()"
|
|
85
|
-
[name]="name()"
|
|
86
|
-
[form]="form()"
|
|
87
|
-
[(model)]="model"
|
|
88
|
-
[items]="search"
|
|
89
|
-
valueField="id"
|
|
90
|
-
displayField="name"
|
|
91
|
-
[required]="required()"
|
|
92
|
-
[autoId]="autoId()">
|
|
93
|
-
<ng-template sdItemDef let-item="item">
|
|
94
|
-
<div class="d-flex align-items-center gap-8">
|
|
95
|
-
<sd-avatar [src]="null" [name]="item.name" [size]="28" />
|
|
96
|
-
<div class="d-flex flex-column">
|
|
97
|
-
<span>{{ item.name }}</span>
|
|
98
|
-
<small class="text-secondary"
|
|
99
|
-
>{{ item.code }} · {{ item.phone }}{{ item.status === 'inactive' ? ' · Ngừng hoạt động' : '' }}</small
|
|
100
|
-
>
|
|
101
|
-
</div>
|
|
102
|
-
</div>
|
|
103
|
-
</ng-template>
|
|
104
|
-
</sd-select>`,
|
|
105
|
-
}]
|
|
106
|
-
}], propDecorators: { form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], model: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: false }] }, { type: i0.Output, args: ["modelChange"] }] } });
|
|
107
|
-
|
|
108
|
-
/** Giá trị form → request lưu. */
|
|
109
|
-
function orderSaveReq(form) {
|
|
110
|
-
const value = form.getRawValue();
|
|
111
|
-
const lines = (value.lines ?? []);
|
|
112
|
-
return {
|
|
113
|
-
customerId: value.customerId ?? '',
|
|
114
|
-
channel: value.channel ?? ORDER_CHANNELS[0],
|
|
115
|
-
warehouse: value.warehouse ?? ORDER_WAREHOUSES[0],
|
|
116
|
-
payment: value.payment ?? ORDER_PAYMENTS[0],
|
|
117
|
-
note: value.note || null,
|
|
118
|
-
lines: lines.map(line => ({
|
|
119
|
-
productId: line.productId ?? '',
|
|
120
|
-
quantity: Number(line.quantity ?? 0),
|
|
121
|
-
unitPrice: Number(line.unitPrice ?? 0),
|
|
122
|
-
})),
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
const options = (values) => values.map(value => ({ value }));
|
|
126
|
-
/** Nhóm "Thông tin chung" của đơn hàng. */
|
|
127
|
-
class GeneralInformationFormComponent {
|
|
128
|
-
form = input.required(/* @ts-ignore */
|
|
129
|
-
...(ngDevMode ? [{ debugName: "form" }] : /* istanbul ignore next */ []));
|
|
130
|
-
seed = input.required(/* @ts-ignore */
|
|
131
|
-
...(ngDevMode ? [{ debugName: "seed" }] : /* istanbul ignore next */ []));
|
|
132
|
-
channels = options(ORDER_CHANNELS);
|
|
133
|
-
warehouses = options(ORDER_WAREHOUSES);
|
|
134
|
-
payments = options(ORDER_PAYMENTS);
|
|
135
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: GeneralInformationFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
136
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.5", type: GeneralInformationFormComponent, isStandalone: true, selector: "general-information-form", inputs: { form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: true, transformFunction: null }, seed: { classPropertyName: "seed", publicName: "seed", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
|
|
137
|
-
<sd-section title="Thông tin chung">
|
|
138
|
-
<div class="row p-8">
|
|
139
|
-
<div class="col-12 col-md-6">
|
|
140
|
-
<customer-select autoId="order-customer" [form]="form()" [model]="seed().customerId || null" required />
|
|
141
|
-
</div>
|
|
142
|
-
<div class="col-12 col-md-6">
|
|
143
|
-
<sd-select
|
|
144
|
-
label="Kênh bán"
|
|
145
|
-
name="channel"
|
|
146
|
-
[form]="form()"
|
|
147
|
-
[model]="seed().channel"
|
|
148
|
-
[items]="channels"
|
|
149
|
-
valueField="value"
|
|
150
|
-
displayField="value"
|
|
151
|
-
[clearable]="false"
|
|
152
|
-
required />
|
|
153
|
-
</div>
|
|
154
|
-
<div class="col-12 col-md-6">
|
|
155
|
-
<sd-select
|
|
156
|
-
label="Kho xuất"
|
|
157
|
-
name="warehouse"
|
|
158
|
-
[form]="form()"
|
|
159
|
-
[model]="seed().warehouse"
|
|
160
|
-
[items]="warehouses"
|
|
161
|
-
valueField="value"
|
|
162
|
-
displayField="value"
|
|
163
|
-
[clearable]="false"
|
|
164
|
-
required />
|
|
165
|
-
</div>
|
|
166
|
-
<div class="col-12 col-md-6">
|
|
167
|
-
<sd-select
|
|
168
|
-
label="Thanh toán"
|
|
169
|
-
name="payment"
|
|
170
|
-
[form]="form()"
|
|
171
|
-
[model]="seed().payment"
|
|
172
|
-
[items]="payments"
|
|
173
|
-
valueField="value"
|
|
174
|
-
displayField="value"
|
|
175
|
-
[clearable]="false"
|
|
176
|
-
required />
|
|
177
|
-
</div>
|
|
178
|
-
</div>
|
|
179
|
-
</sd-section>
|
|
180
|
-
`, isInline: true, dependencies: [{ kind: "component", type: SdSection, selector: "sd-section", inputs: ["title", "subTitle", "icon", "iconColor", "iconShape", "collapsed", "collapsible", "hideHeader"], outputs: ["collapsedChange"] }, { kind: "component", type: SdSelect, selector: "sd-select", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "valueField", "displayField", "disabledField", "cacheChecksum", "limit", "virtualScroll", "itemSize", "hyperlink", "minWidthPanel", "hideInlineError", "hideReadError", "required", "disabled", "viewed", "multiple", "showSelectAll", "clearable", "validator", "inlineError", "appearance", "floatLabel", "labelPlacement", "items", "model"], outputs: ["operatorChange", "sdReadStateChange", "modelChange", "sdChange", "sdSelection"] }, { kind: "component", type: CustomerSelectComponent, selector: "customer-select", inputs: ["form", "name", "label", "required", "autoId", "model"], outputs: ["modelChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
181
|
-
}
|
|
182
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: GeneralInformationFormComponent, decorators: [{
|
|
183
|
-
type: Component,
|
|
184
|
-
args: [{
|
|
185
|
-
selector: 'general-information-form',
|
|
186
|
-
standalone: true,
|
|
187
|
-
imports: [SdSection, SdSelect, CustomerSelectComponent],
|
|
188
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
189
|
-
template: `
|
|
190
|
-
<sd-section title="Thông tin chung">
|
|
191
|
-
<div class="row p-8">
|
|
192
|
-
<div class="col-12 col-md-6">
|
|
193
|
-
<customer-select autoId="order-customer" [form]="form()" [model]="seed().customerId || null" required />
|
|
194
|
-
</div>
|
|
195
|
-
<div class="col-12 col-md-6">
|
|
196
|
-
<sd-select
|
|
197
|
-
label="Kênh bán"
|
|
198
|
-
name="channel"
|
|
199
|
-
[form]="form()"
|
|
200
|
-
[model]="seed().channel"
|
|
201
|
-
[items]="channels"
|
|
202
|
-
valueField="value"
|
|
203
|
-
displayField="value"
|
|
204
|
-
[clearable]="false"
|
|
205
|
-
required />
|
|
206
|
-
</div>
|
|
207
|
-
<div class="col-12 col-md-6">
|
|
208
|
-
<sd-select
|
|
209
|
-
label="Kho xuất"
|
|
210
|
-
name="warehouse"
|
|
211
|
-
[form]="form()"
|
|
212
|
-
[model]="seed().warehouse"
|
|
213
|
-
[items]="warehouses"
|
|
214
|
-
valueField="value"
|
|
215
|
-
displayField="value"
|
|
216
|
-
[clearable]="false"
|
|
217
|
-
required />
|
|
218
|
-
</div>
|
|
219
|
-
<div class="col-12 col-md-6">
|
|
220
|
-
<sd-select
|
|
221
|
-
label="Thanh toán"
|
|
222
|
-
name="payment"
|
|
223
|
-
[form]="form()"
|
|
224
|
-
[model]="seed().payment"
|
|
225
|
-
[items]="payments"
|
|
226
|
-
valueField="value"
|
|
227
|
-
displayField="value"
|
|
228
|
-
[clearable]="false"
|
|
229
|
-
required />
|
|
230
|
-
</div>
|
|
231
|
-
</div>
|
|
232
|
-
</sd-section>
|
|
233
|
-
`,
|
|
234
|
-
}]
|
|
235
|
-
}], propDecorators: { form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: true }] }], seed: [{ type: i0.Input, args: [{ isSignal: true, alias: "seed", required: true }] }] } });
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* Chọn sản phẩm cho màn khác (dòng đơn hàng). Lựa chọn mới chỉ gồm sản phẩm đang hoạt động; giá trị đã chọn
|
|
239
|
-
* được tải theo ID (`VALUE`) nên sản phẩm đã ngừng vẫn hiển thị khi cập nhật. Option hai dòng: tên · mã · đơn vị.
|
|
240
|
-
*/
|
|
241
|
-
class ProductSelectComponent {
|
|
242
|
-
#productService = inject(ProductService);
|
|
243
|
-
form = input(/* @ts-ignore */
|
|
244
|
-
...(ngDevMode ? [undefined, { debugName: "form" }] : /* istanbul ignore next */ []));
|
|
245
|
-
name = input('productId', /* @ts-ignore */
|
|
246
|
-
...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
247
|
-
label = input('Sản phẩm', /* @ts-ignore */
|
|
248
|
-
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
249
|
-
required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
250
|
-
autoId = input(/* @ts-ignore */
|
|
251
|
-
...(ngDevMode ? [undefined, { debugName: "autoId" }] : /* istanbul ignore next */ []));
|
|
252
|
-
model = model(/* @ts-ignore */
|
|
253
|
-
...(ngDevMode ? [undefined, { debugName: "model" }] : /* istanbul ignore next */ []));
|
|
254
|
-
search = async (req) => {
|
|
255
|
-
if (req.type === 'VALUE') {
|
|
256
|
-
const ids = (Array.isArray(req.value) ? req.value : [req.value]).filter((id) => !!id);
|
|
257
|
-
return Promise.all(ids.map(id => firstValueFrom(this.#productService.cachedDetail(id))));
|
|
258
|
-
}
|
|
259
|
-
const filters = [{ field: 'status', operator: 'EQUAL', data: 'active' }];
|
|
260
|
-
if (req.searchText) {
|
|
261
|
-
filters.push({
|
|
262
|
-
operator: 'OR',
|
|
263
|
-
data: [
|
|
264
|
-
{ field: 'name', operator: 'CONTAIN', data: req.searchText },
|
|
265
|
-
{ field: 'code', operator: 'CONTAIN', data: req.searchText },
|
|
266
|
-
],
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
const res = await firstValueFrom(this.#productService.list({ pageNumber: 0, pageSize: 20, filters }));
|
|
270
|
-
return res.items;
|
|
271
|
-
};
|
|
272
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: ProductSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
273
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.5", type: ProductSelectComponent, isStandalone: true, selector: "product-select", inputs: { form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { model: "modelChange" }, ngImport: i0, template: `<sd-select
|
|
274
|
-
[label]="label()"
|
|
275
|
-
[name]="name()"
|
|
276
|
-
[form]="form()"
|
|
277
|
-
[(model)]="model"
|
|
278
|
-
[items]="search"
|
|
279
|
-
valueField="id"
|
|
280
|
-
displayField="name"
|
|
281
|
-
[required]="required()"
|
|
282
|
-
[autoId]="autoId()">
|
|
283
|
-
<ng-template sdItemDef let-item="item">
|
|
284
|
-
<div class="d-flex flex-column">
|
|
285
|
-
<span>{{ item.name }}</span>
|
|
286
|
-
<small class="text-secondary">{{ item.code }} · {{ item.unit }}{{ item.status === 'inactive' ? ' · Ngừng hoạt động' : '' }}</small>
|
|
287
|
-
</div>
|
|
288
|
-
</ng-template>
|
|
289
|
-
</sd-select>`, isInline: true, dependencies: [{ kind: "component", type: SdSelect, selector: "sd-select", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "valueField", "displayField", "disabledField", "cacheChecksum", "limit", "virtualScroll", "itemSize", "hyperlink", "minWidthPanel", "hideInlineError", "hideReadError", "required", "disabled", "viewed", "multiple", "showSelectAll", "clearable", "validator", "inlineError", "appearance", "floatLabel", "labelPlacement", "items", "model"], outputs: ["operatorChange", "sdReadStateChange", "modelChange", "sdChange", "sdSelection"] }, { kind: "directive", type: SdItemDefDefDirective, selector: "[sdItemDef]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
290
|
-
}
|
|
291
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: ProductSelectComponent, decorators: [{
|
|
292
|
-
type: Component,
|
|
293
|
-
args: [{
|
|
294
|
-
selector: 'product-select',
|
|
295
|
-
standalone: true,
|
|
296
|
-
imports: [SdSelect, SdItemDefDefDirective],
|
|
297
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
298
|
-
template: `<sd-select
|
|
299
|
-
[label]="label()"
|
|
300
|
-
[name]="name()"
|
|
301
|
-
[form]="form()"
|
|
302
|
-
[(model)]="model"
|
|
303
|
-
[items]="search"
|
|
304
|
-
valueField="id"
|
|
305
|
-
displayField="name"
|
|
306
|
-
[required]="required()"
|
|
307
|
-
[autoId]="autoId()">
|
|
308
|
-
<ng-template sdItemDef let-item="item">
|
|
309
|
-
<div class="d-flex flex-column">
|
|
310
|
-
<span>{{ item.name }}</span>
|
|
311
|
-
<small class="text-secondary">{{ item.code }} · {{ item.unit }}{{ item.status === 'inactive' ? ' · Ngừng hoạt động' : '' }}</small>
|
|
312
|
-
</div>
|
|
313
|
-
</ng-template>
|
|
314
|
-
</sd-select>`,
|
|
315
|
-
}]
|
|
316
|
-
}], propDecorators: { form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], model: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: false }] }, { type: i0.Output, args: ["modelChange"] }] } });
|
|
317
|
-
|
|
318
|
-
/**
|
|
319
|
-
* Bảng dòng hàng nhập trực tiếp: mỗi dòng là một FormGroup trong `form.lines` (FormArray), các field Core tự đăng
|
|
320
|
-
* ký vào dòng. Chọn sản phẩm điền đơn giá; thành tiền và tổng tự tính. Lỗi API theo dòng (`lines.<i>.<field>`) hiện
|
|
321
|
-
* ngay trên ô của dòng đó.
|
|
322
|
-
*/
|
|
323
|
-
class LinesFormComponent {
|
|
324
|
-
#productService = inject(ProductService);
|
|
325
|
-
form = input.required(/* @ts-ignore */
|
|
326
|
-
...(ngDevMode ? [{ debugName: "form" }] : /* istanbul ignore next */ []));
|
|
327
|
-
/** Dòng ban đầu (cập nhật) hoặc một dòng trống (tạo mới). */
|
|
328
|
-
seed = input.required(/* @ts-ignore */
|
|
329
|
-
...(ngDevMode ? [{ debugName: "seed" }] : /* istanbul ignore next */ []));
|
|
330
|
-
/** Lỗi theo field do API trả về, khoá dạng `lines.<index>.<field>`. */
|
|
331
|
-
errors = input({}, /* @ts-ignore */
|
|
332
|
-
...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
333
|
-
#array = new FormArray([]);
|
|
334
|
-
#version = signal(0, /* @ts-ignore */
|
|
335
|
-
...(ngDevMode ? [{ debugName: "#version" }] : /* istanbul ignore next */ []));
|
|
336
|
-
#nextKey = 0;
|
|
337
|
-
rows = signal([], /* @ts-ignore */
|
|
338
|
-
...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
|
|
339
|
-
amounts = computed(() => {
|
|
340
|
-
this.#version();
|
|
341
|
-
return this.rows().map(row => Number(row.group.get('quantity')?.value ?? row.seed.quantity) * Number(row.group.get('unitPrice')?.value ?? row.seed.unitPrice));
|
|
342
|
-
}, /* @ts-ignore */
|
|
343
|
-
...(ngDevMode ? [{ debugName: "amounts" }] : /* istanbul ignore next */ []));
|
|
344
|
-
total = computed(() => this.amounts().reduce((sum, amount) => sum + amount, 0), /* @ts-ignore */
|
|
345
|
-
...(ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []));
|
|
346
|
-
constructor() {
|
|
347
|
-
const subscription = this.#array.valueChanges.subscribe(() => this.#version.update(version => version + 1));
|
|
348
|
-
inject(DestroyRef).onDestroy(() => subscription.unsubscribe());
|
|
349
|
-
// why: trang cập nhật được dùng lại khi chỉ đổi `:id`; dòng hàng phải theo đơn mới, không giữ dòng của đơn trước.
|
|
350
|
-
effect(() => {
|
|
351
|
-
const seed = this.seed();
|
|
352
|
-
untracked(() => this.#load(seed));
|
|
353
|
-
});
|
|
354
|
-
}
|
|
355
|
-
add() {
|
|
356
|
-
this.#push({ productId: '', quantity: 1, unitPrice: 0 });
|
|
357
|
-
}
|
|
358
|
-
remove(row) {
|
|
359
|
-
const index = this.rows().indexOf(row);
|
|
360
|
-
if (index < 0)
|
|
361
|
-
return;
|
|
362
|
-
// why: đánh dấu đã sửa TRƯỚC khi gỡ, để dirty theo giá trị so với danh sách dòng lúc trước.
|
|
363
|
-
this.#array.markAsDirty();
|
|
364
|
-
this.#array.removeAt(index);
|
|
365
|
-
this.rows.update(rows => rows.filter(item => item !== row));
|
|
366
|
-
}
|
|
367
|
-
/** Chọn sản phẩm thì điền đơn giá hiện hành của sản phẩm. */
|
|
368
|
-
async pick(row, productId) {
|
|
369
|
-
if (!productId)
|
|
370
|
-
return;
|
|
371
|
-
const product = await firstValueFrom(this.#productService.cachedDetail(productId));
|
|
372
|
-
row.group.get('unitPrice')?.setValue(product.price);
|
|
373
|
-
}
|
|
374
|
-
#load(seed) {
|
|
375
|
-
this.#array.clear();
|
|
376
|
-
this.rows.set([]);
|
|
377
|
-
(seed.length ? seed : [{ productId: '', quantity: 1, unitPrice: 0 }]).forEach(line => this.#push(line));
|
|
378
|
-
if (this.form().get('lines') !== this.#array)
|
|
379
|
-
this.form().setControl('lines', this.#array);
|
|
380
|
-
}
|
|
381
|
-
#push(seed) {
|
|
382
|
-
const group = new FormGroup({});
|
|
383
|
-
this.#array.push(group);
|
|
384
|
-
this.rows.update(rows => [...rows, { key: this.#nextKey++, group, seed }]);
|
|
385
|
-
}
|
|
386
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: LinesFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
387
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: LinesFormComponent, isStandalone: true, selector: "lines-form", inputs: { form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: true, transformFunction: null }, seed: { classPropertyName: "seed", publicName: "seed", isSignal: true, isRequired: true, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
388
|
-
<sd-section title="Dòng hàng">
|
|
389
|
-
<div sdHeaderRight>
|
|
390
|
-
<sd-button title="Thêm dòng" prefixIcon="add" type="text" autoId="order-line-add" (click)="add()" />
|
|
391
|
-
</div>
|
|
392
|
-
<table class="lines">
|
|
393
|
-
<thead>
|
|
394
|
-
<tr>
|
|
395
|
-
<th scope="col">Sản phẩm</th>
|
|
396
|
-
<th scope="col" class="lines__number">Số lượng</th>
|
|
397
|
-
<th scope="col" class="lines__number">Đơn giá (₫)</th>
|
|
398
|
-
<th scope="col" class="lines__number">Thành tiền (₫)</th>
|
|
399
|
-
<th scope="col"><span class="sd-visually-hidden">Xoá dòng</span></th>
|
|
400
|
-
</tr>
|
|
401
|
-
</thead>
|
|
402
|
-
<tbody>
|
|
403
|
-
@for (row of rows(); track row.key; let index = $index) {
|
|
404
|
-
<tr [attr.data-line]="index">
|
|
405
|
-
<td>
|
|
406
|
-
<product-select
|
|
407
|
-
[label]="undefined"
|
|
408
|
-
[form]="row.group"
|
|
409
|
-
[model]="row.seed.productId || null"
|
|
410
|
-
[autoId]="'order-line-' + index + '-product'"
|
|
411
|
-
(modelChange)="pick(row, $event)"
|
|
412
|
-
required />
|
|
413
|
-
@if (errors()['lines.' + index + '.productId']; as error) {
|
|
414
|
-
<span class="lines__error" role="alert">{{ error }}</span>
|
|
415
|
-
}
|
|
416
|
-
</td>
|
|
417
|
-
<td class="lines__number">
|
|
418
|
-
<sd-input-number
|
|
419
|
-
name="quantity"
|
|
420
|
-
type="positive"
|
|
421
|
-
[precision]="0"
|
|
422
|
-
[form]="row.group"
|
|
423
|
-
[model]="row.seed.quantity"
|
|
424
|
-
[inlineError]="errors()['lines.' + index + '.quantity']"
|
|
425
|
-
[autoId]="'order-line-' + index + '-quantity'"
|
|
426
|
-
required />
|
|
427
|
-
</td>
|
|
428
|
-
<td class="lines__number">
|
|
429
|
-
<sd-input-number
|
|
430
|
-
name="unitPrice"
|
|
431
|
-
type="positive"
|
|
432
|
-
[precision]="0"
|
|
433
|
-
[form]="row.group"
|
|
434
|
-
[model]="row.seed.unitPrice"
|
|
435
|
-
required />
|
|
436
|
-
</td>
|
|
437
|
-
<td class="lines__number">{{ amounts()[index] | sdFormatNumber: 0 }}</td>
|
|
438
|
-
<td>
|
|
439
|
-
<sd-button
|
|
440
|
-
prefixIcon="delete"
|
|
441
|
-
type="text"
|
|
442
|
-
color="error"
|
|
443
|
-
tooltip="Xoá dòng"
|
|
444
|
-
[autoId]="'order-line-' + index + '-remove'"
|
|
445
|
-
[disabled]="rows().length === 1"
|
|
446
|
-
(click)="remove(row)" />
|
|
447
|
-
</td>
|
|
448
|
-
</tr>
|
|
449
|
-
}
|
|
450
|
-
</tbody>
|
|
451
|
-
<tfoot>
|
|
452
|
-
<tr>
|
|
453
|
-
<th scope="row" colspan="3" class="lines__number">Tổng tiền (₫)</th>
|
|
454
|
-
<td class="lines__number lines__total" data-autoid="order-total">{{ total() | sdFormatNumber: 0 }}</td>
|
|
455
|
-
<td></td>
|
|
456
|
-
</tr>
|
|
457
|
-
</tfoot>
|
|
458
|
-
</table>
|
|
459
|
-
</sd-section>
|
|
460
|
-
`, isInline: true, styles: [".lines{width:100%;border-collapse:collapse}.lines th,.lines td{padding:4px 8px;text-align:left;vertical-align:top}.lines thead th{color:var(--sd-text-secondary);font-size:12px;font-weight:500;border-bottom:1px solid var(--sd-border)}.lines td:first-child{min-width:240px}.lines__number{width:150px;text-align:right!important}.lines td.lines__number{padding-top:14px}.lines tfoot th,.lines tfoot td{padding-top:12px;border-top:1px solid var(--sd-border)}.lines__total{font-weight:500}.lines__error{color:var(--sd-error, currentColor);font-size:12px}\n"], dependencies: [{ kind: "component", type: SdSection, selector: "sd-section", inputs: ["title", "subTitle", "icon", "iconColor", "iconShape", "collapsed", "collapsible", "hideHeader"], outputs: ["collapsedChange"] }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType", "indicator", "indicatorColor", "indicatorMax", "indicatorLabel"], outputs: ["click"] }, { kind: "component", type: SdInputNumber, selector: "sd-input-number", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "type", "precision", "format", "min", "max", "validator", "inlineError", "hyperlink", "appearance", "floatLabel", "labelPlacement", "inputmode", "model"], outputs: ["operatorChange", "modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }, { kind: "component", type: ProductSelectComponent, selector: "product-select", inputs: ["form", "name", "label", "required", "autoId", "model"], outputs: ["modelChange"] }, { kind: "pipe", type: SdFormatNumberPipe, name: "sdFormatNumber" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
461
|
-
}
|
|
462
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: LinesFormComponent, decorators: [{
|
|
463
|
-
type: Component,
|
|
464
|
-
args: [{ selector: 'lines-form', standalone: true, imports: [SdSection, SdButton, SdInputNumber, SdFormatNumberPipe, ProductSelectComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
465
|
-
<sd-section title="Dòng hàng">
|
|
466
|
-
<div sdHeaderRight>
|
|
467
|
-
<sd-button title="Thêm dòng" prefixIcon="add" type="text" autoId="order-line-add" (click)="add()" />
|
|
468
|
-
</div>
|
|
469
|
-
<table class="lines">
|
|
470
|
-
<thead>
|
|
471
|
-
<tr>
|
|
472
|
-
<th scope="col">Sản phẩm</th>
|
|
473
|
-
<th scope="col" class="lines__number">Số lượng</th>
|
|
474
|
-
<th scope="col" class="lines__number">Đơn giá (₫)</th>
|
|
475
|
-
<th scope="col" class="lines__number">Thành tiền (₫)</th>
|
|
476
|
-
<th scope="col"><span class="sd-visually-hidden">Xoá dòng</span></th>
|
|
477
|
-
</tr>
|
|
478
|
-
</thead>
|
|
479
|
-
<tbody>
|
|
480
|
-
@for (row of rows(); track row.key; let index = $index) {
|
|
481
|
-
<tr [attr.data-line]="index">
|
|
482
|
-
<td>
|
|
483
|
-
<product-select
|
|
484
|
-
[label]="undefined"
|
|
485
|
-
[form]="row.group"
|
|
486
|
-
[model]="row.seed.productId || null"
|
|
487
|
-
[autoId]="'order-line-' + index + '-product'"
|
|
488
|
-
(modelChange)="pick(row, $event)"
|
|
489
|
-
required />
|
|
490
|
-
@if (errors()['lines.' + index + '.productId']; as error) {
|
|
491
|
-
<span class="lines__error" role="alert">{{ error }}</span>
|
|
492
|
-
}
|
|
493
|
-
</td>
|
|
494
|
-
<td class="lines__number">
|
|
495
|
-
<sd-input-number
|
|
496
|
-
name="quantity"
|
|
497
|
-
type="positive"
|
|
498
|
-
[precision]="0"
|
|
499
|
-
[form]="row.group"
|
|
500
|
-
[model]="row.seed.quantity"
|
|
501
|
-
[inlineError]="errors()['lines.' + index + '.quantity']"
|
|
502
|
-
[autoId]="'order-line-' + index + '-quantity'"
|
|
503
|
-
required />
|
|
504
|
-
</td>
|
|
505
|
-
<td class="lines__number">
|
|
506
|
-
<sd-input-number
|
|
507
|
-
name="unitPrice"
|
|
508
|
-
type="positive"
|
|
509
|
-
[precision]="0"
|
|
510
|
-
[form]="row.group"
|
|
511
|
-
[model]="row.seed.unitPrice"
|
|
512
|
-
required />
|
|
513
|
-
</td>
|
|
514
|
-
<td class="lines__number">{{ amounts()[index] | sdFormatNumber: 0 }}</td>
|
|
515
|
-
<td>
|
|
516
|
-
<sd-button
|
|
517
|
-
prefixIcon="delete"
|
|
518
|
-
type="text"
|
|
519
|
-
color="error"
|
|
520
|
-
tooltip="Xoá dòng"
|
|
521
|
-
[autoId]="'order-line-' + index + '-remove'"
|
|
522
|
-
[disabled]="rows().length === 1"
|
|
523
|
-
(click)="remove(row)" />
|
|
524
|
-
</td>
|
|
525
|
-
</tr>
|
|
526
|
-
}
|
|
527
|
-
</tbody>
|
|
528
|
-
<tfoot>
|
|
529
|
-
<tr>
|
|
530
|
-
<th scope="row" colspan="3" class="lines__number">Tổng tiền (₫)</th>
|
|
531
|
-
<td class="lines__number lines__total" data-autoid="order-total">{{ total() | sdFormatNumber: 0 }}</td>
|
|
532
|
-
<td></td>
|
|
533
|
-
</tr>
|
|
534
|
-
</tfoot>
|
|
535
|
-
</table>
|
|
536
|
-
</sd-section>
|
|
537
|
-
`, styles: [".lines{width:100%;border-collapse:collapse}.lines th,.lines td{padding:4px 8px;text-align:left;vertical-align:top}.lines thead th{color:var(--sd-text-secondary);font-size:12px;font-weight:500;border-bottom:1px solid var(--sd-border)}.lines td:first-child{min-width:240px}.lines__number{width:150px;text-align:right!important}.lines td.lines__number{padding-top:14px}.lines tfoot th,.lines tfoot td{padding-top:12px;border-top:1px solid var(--sd-border)}.lines__total{font-weight:500}.lines__error{color:var(--sd-error, currentColor);font-size:12px}\n"] }]
|
|
538
|
-
}], ctorParameters: () => [], propDecorators: { form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: true }] }], seed: [{ type: i0.Input, args: [{ isSignal: true, alias: "seed", required: true }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }] } });
|
|
539
|
-
|
|
540
|
-
export { GeneralInformationFormComponent as G, LinesFormComponent as L, orderSaveReq as o };
|
|
541
|
-
//# sourceMappingURL=sdcorejs-angular-modules-pattern-lines-form.component-BK__9Mzb.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sdcorejs-angular-modules-pattern-lines-form.component-BK__9Mzb.mjs","sources":["../../../projects/sdcorejs-angular/modules/pattern/features/customer/components/customer-select/customer-select.component.ts","../../../projects/sdcorejs-angular/modules/pattern/features/order/components/general-information-form/general-information-form.component.ts","../../../projects/sdcorejs-angular/modules/pattern/features/product/components/product-select/product-select.component.ts","../../../projects/sdcorejs-angular/modules/pattern/features/order/components/lines-form/lines-form.component.ts"],"sourcesContent":["import { booleanAttribute, ChangeDetectionStrategy, Component, inject, input, model } from '@angular/core';\nimport type { FormGroup } from '@angular/forms';\nimport { firstValueFrom } from 'rxjs';\nimport { SdAvatar } from '@sdcorejs/angular/components/avatar';\nimport { SdItemDefDefDirective } from '@sdcorejs/angular/forms/directives';\nimport type { SdSearchReq } from '@sdcorejs/angular/forms/models';\nimport { SdSelect } from '@sdcorejs/angular/forms/select';\nimport type { Filter } from '@sdcorejs/utils/models';\nimport { CustomerService } from '../../services/customer.service';\nimport type { CustomerDto } from '../../services/customer.model';\n\n/**\n * Chọn khách hàng cho màn khác (đơn hàng). Lựa chọn mới chỉ gồm khách đang hoạt động; giá trị đã chọn tải theo ID\n * (`VALUE`) nên khách đã ngừng vẫn hiện khi cập nhật. Option hai dòng có avatar: tên · mã · điện thoại.\n */\n@Component({\n selector: 'customer-select',\n standalone: true,\n imports: [SdSelect, SdItemDefDefDirective, SdAvatar],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `<sd-select\n [label]=\"label()\"\n [name]=\"name()\"\n [form]=\"form()\"\n [(model)]=\"model\"\n [items]=\"search\"\n valueField=\"id\"\n displayField=\"name\"\n [required]=\"required()\"\n [autoId]=\"autoId()\">\n <ng-template sdItemDef let-item=\"item\">\n <div class=\"d-flex align-items-center gap-8\">\n <sd-avatar [src]=\"null\" [name]=\"item.name\" [size]=\"28\" />\n <div class=\"d-flex flex-column\">\n <span>{{ item.name }}</span>\n <small class=\"text-secondary\"\n >{{ item.code }} · {{ item.phone }}{{ item.status === 'inactive' ? ' · Ngừng hoạt động' : '' }}</small\n >\n </div>\n </div>\n </ng-template>\n </sd-select>`,\n})\nexport class CustomerSelectComponent {\n readonly #customerService = inject(CustomerService);\n readonly form = input<FormGroup>();\n readonly name = input('customerId');\n readonly label = input<string | undefined>('Khách hàng');\n readonly required = input(false, { transform: booleanAttribute });\n readonly autoId = input<string>();\n readonly model = model<string | null | undefined>();\n\n protected readonly search = async (req: SdSearchReq): Promise<CustomerDto[]> => {\n if (req.type === 'VALUE') {\n const ids = (Array.isArray(req.value) ? req.value : [req.value]).filter((id): id is string => !!id);\n return Promise.all(ids.map(id => firstValueFrom(this.#customerService.cachedDetail(id))));\n }\n const filters: Filter<CustomerDto>[] = [{ field: 'status', operator: 'EQUAL', data: 'active' }];\n if (req.searchText) {\n filters.push({\n operator: 'OR',\n data: [\n { field: 'name', operator: 'CONTAIN', data: req.searchText },\n { field: 'code', operator: 'CONTAIN', data: req.searchText },\n { field: 'phone', operator: 'CONTAIN', data: req.searchText },\n ],\n });\n }\n const res = await firstValueFrom(this.#customerService.list({ pageNumber: 0, pageSize: 20, filters }));\n return res.items;\n };\n}\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport type { FormArray, FormControl, FormGroup } from '@angular/forms';\nimport { SdSection } from '@sdcorejs/angular/components/section';\nimport { SdSelect } from '@sdcorejs/angular/forms/select';\nimport { CustomerSelectComponent } from '../../../customer/components/customer-select/customer-select.component';\nimport { ORDER_CHANNELS, ORDER_PAYMENTS, ORDER_WAREHOUSES, type OrderLineDto, type OrderSaveReq } from '../../services/order.model';\n\n/** Form đơn hàng: field của đầu chứng từ do Core tự đăng ký; `lines` là FormArray do `lines-form` quản lý. */\nexport type OrderForm = FormGroup<{\n customerId?: FormControl<string | null>;\n channel?: FormControl<string>;\n warehouse?: FormControl<string>;\n payment?: FormControl<string>;\n note?: FormControl<string | null>;\n lines?: FormArray<FormGroup>;\n}>;\n\n/** Giá trị form → request lưu. */\nexport function orderSaveReq(form: OrderForm): OrderSaveReq {\n const value = form.getRawValue();\n const lines = (value.lines ?? []) as Partial<OrderLineDto>[];\n return {\n customerId: value.customerId ?? '',\n channel: value.channel ?? ORDER_CHANNELS[0],\n warehouse: value.warehouse ?? ORDER_WAREHOUSES[0],\n payment: value.payment ?? ORDER_PAYMENTS[0],\n note: value.note || null,\n lines: lines.map(line => ({\n productId: line.productId ?? '',\n quantity: Number(line.quantity ?? 0),\n unitPrice: Number(line.unitPrice ?? 0),\n })),\n };\n}\n\nconst options = (values: readonly string[]) => values.map(value => ({ value }));\n\n/** Nhóm \"Thông tin chung\" của đơn hàng. */\n@Component({\n selector: 'general-information-form',\n standalone: true,\n imports: [SdSection, SdSelect, CustomerSelectComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <sd-section title=\"Thông tin chung\">\n <div class=\"row p-8\">\n <div class=\"col-12 col-md-6\">\n <customer-select autoId=\"order-customer\" [form]=\"form()\" [model]=\"seed().customerId || null\" required />\n </div>\n <div class=\"col-12 col-md-6\">\n <sd-select\n label=\"Kênh bán\"\n name=\"channel\"\n [form]=\"form()\"\n [model]=\"seed().channel\"\n [items]=\"channels\"\n valueField=\"value\"\n displayField=\"value\"\n [clearable]=\"false\"\n required />\n </div>\n <div class=\"col-12 col-md-6\">\n <sd-select\n label=\"Kho xuất\"\n name=\"warehouse\"\n [form]=\"form()\"\n [model]=\"seed().warehouse\"\n [items]=\"warehouses\"\n valueField=\"value\"\n displayField=\"value\"\n [clearable]=\"false\"\n required />\n </div>\n <div class=\"col-12 col-md-6\">\n <sd-select\n label=\"Thanh toán\"\n name=\"payment\"\n [form]=\"form()\"\n [model]=\"seed().payment\"\n [items]=\"payments\"\n valueField=\"value\"\n displayField=\"value\"\n [clearable]=\"false\"\n required />\n </div>\n </div>\n </sd-section>\n `,\n})\nexport class GeneralInformationFormComponent {\n readonly form = input.required<OrderForm>();\n readonly seed = input.required<OrderSaveReq>();\n protected readonly channels = options(ORDER_CHANNELS);\n protected readonly warehouses = options(ORDER_WAREHOUSES);\n protected readonly payments = options(ORDER_PAYMENTS);\n}\n","import { booleanAttribute, ChangeDetectionStrategy, Component, inject, input, model } from '@angular/core';\nimport type { FormGroup } from '@angular/forms';\nimport { firstValueFrom } from 'rxjs';\nimport { SdItemDefDefDirective } from '@sdcorejs/angular/forms/directives';\nimport type { SdSearchReq } from '@sdcorejs/angular/forms/models';\nimport { SdSelect } from '@sdcorejs/angular/forms/select';\nimport type { Filter } from '@sdcorejs/utils/models';\nimport { ProductService } from '../../services/product.service';\nimport type { ProductDto } from '../../services/product.model';\n\n/**\n * Chọn sản phẩm cho màn khác (dòng đơn hàng). Lựa chọn mới chỉ gồm sản phẩm đang hoạt động; giá trị đã chọn\n * được tải theo ID (`VALUE`) nên sản phẩm đã ngừng vẫn hiển thị khi cập nhật. Option hai dòng: tên · mã · đơn vị.\n */\n@Component({\n selector: 'product-select',\n standalone: true,\n imports: [SdSelect, SdItemDefDefDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `<sd-select\n [label]=\"label()\"\n [name]=\"name()\"\n [form]=\"form()\"\n [(model)]=\"model\"\n [items]=\"search\"\n valueField=\"id\"\n displayField=\"name\"\n [required]=\"required()\"\n [autoId]=\"autoId()\">\n <ng-template sdItemDef let-item=\"item\">\n <div class=\"d-flex flex-column\">\n <span>{{ item.name }}</span>\n <small class=\"text-secondary\">{{ item.code }} · {{ item.unit }}{{ item.status === 'inactive' ? ' · Ngừng hoạt động' : '' }}</small>\n </div>\n </ng-template>\n </sd-select>`,\n})\nexport class ProductSelectComponent {\n readonly #productService = inject(ProductService);\n readonly form = input<FormGroup>();\n readonly name = input('productId');\n readonly label = input<string | undefined>('Sản phẩm');\n readonly required = input(false, { transform: booleanAttribute });\n readonly autoId = input<string>();\n readonly model = model<string | null | undefined>();\n\n protected readonly search = async (req: SdSearchReq): Promise<ProductDto[]> => {\n if (req.type === 'VALUE') {\n const ids = (Array.isArray(req.value) ? req.value : [req.value]).filter((id): id is string => !!id);\n return Promise.all(ids.map(id => firstValueFrom(this.#productService.cachedDetail(id))));\n }\n const filters: Filter<ProductDto>[] = [{ field: 'status', operator: 'EQUAL', data: 'active' }];\n if (req.searchText) {\n filters.push({\n operator: 'OR',\n data: [\n { field: 'name', operator: 'CONTAIN', data: req.searchText },\n { field: 'code', operator: 'CONTAIN', data: req.searchText },\n ],\n });\n }\n const res = await firstValueFrom(this.#productService.list({ pageNumber: 0, pageSize: 20, filters }));\n return res.items;\n };\n}\n","import { ChangeDetectionStrategy, Component, computed, DestroyRef, effect, inject, input, signal, untracked } from '@angular/core';\nimport { FormArray, FormGroup } from '@angular/forms';\nimport { firstValueFrom } from 'rxjs';\nimport { SdButton } from '@sdcorejs/angular/components/button';\nimport { SdSection } from '@sdcorejs/angular/components/section';\nimport { SdInputNumber } from '@sdcorejs/angular/forms/input-number';\nimport { SdFormatNumberPipe } from '@sdcorejs/angular/pipes';\nimport { ProductSelectComponent } from '../../../product/components/product-select/product-select.component';\nimport { ProductService } from '../../../product/services/product.service';\nimport type { OrderLineDto } from '../../services/order.model';\nimport type { OrderForm } from '../general-information-form/general-information-form.component';\n\ninterface LineRow {\n readonly key: number;\n readonly group: FormGroup;\n readonly seed: OrderLineDto;\n}\n\n/**\n * Bảng dòng hàng nhập trực tiếp: mỗi dòng là một FormGroup trong `form.lines` (FormArray), các field Core tự đăng\n * ký vào dòng. Chọn sản phẩm điền đơn giá; thành tiền và tổng tự tính. Lỗi API theo dòng (`lines.<i>.<field>`) hiện\n * ngay trên ô của dòng đó.\n */\n@Component({\n selector: 'lines-form',\n standalone: true,\n imports: [SdSection, SdButton, SdInputNumber, SdFormatNumberPipe, ProductSelectComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <sd-section title=\"Dòng hàng\">\n <div sdHeaderRight>\n <sd-button title=\"Thêm dòng\" prefixIcon=\"add\" type=\"text\" autoId=\"order-line-add\" (click)=\"add()\" />\n </div>\n <table class=\"lines\">\n <thead>\n <tr>\n <th scope=\"col\">Sản phẩm</th>\n <th scope=\"col\" class=\"lines__number\">Số lượng</th>\n <th scope=\"col\" class=\"lines__number\">Đơn giá (₫)</th>\n <th scope=\"col\" class=\"lines__number\">Thành tiền (₫)</th>\n <th scope=\"col\"><span class=\"sd-visually-hidden\">Xoá dòng</span></th>\n </tr>\n </thead>\n <tbody>\n @for (row of rows(); track row.key; let index = $index) {\n <tr [attr.data-line]=\"index\">\n <td>\n <product-select\n [label]=\"undefined\"\n [form]=\"row.group\"\n [model]=\"row.seed.productId || null\"\n [autoId]=\"'order-line-' + index + '-product'\"\n (modelChange)=\"pick(row, $event)\"\n required />\n @if (errors()['lines.' + index + '.productId']; as error) {\n <span class=\"lines__error\" role=\"alert\">{{ error }}</span>\n }\n </td>\n <td class=\"lines__number\">\n <sd-input-number\n name=\"quantity\"\n type=\"positive\"\n [precision]=\"0\"\n [form]=\"row.group\"\n [model]=\"row.seed.quantity\"\n [inlineError]=\"errors()['lines.' + index + '.quantity']\"\n [autoId]=\"'order-line-' + index + '-quantity'\"\n required />\n </td>\n <td class=\"lines__number\">\n <sd-input-number\n name=\"unitPrice\"\n type=\"positive\"\n [precision]=\"0\"\n [form]=\"row.group\"\n [model]=\"row.seed.unitPrice\"\n required />\n </td>\n <td class=\"lines__number\">{{ amounts()[index] | sdFormatNumber: 0 }}</td>\n <td>\n <sd-button\n prefixIcon=\"delete\"\n type=\"text\"\n color=\"error\"\n tooltip=\"Xoá dòng\"\n [autoId]=\"'order-line-' + index + '-remove'\"\n [disabled]=\"rows().length === 1\"\n (click)=\"remove(row)\" />\n </td>\n </tr>\n }\n </tbody>\n <tfoot>\n <tr>\n <th scope=\"row\" colspan=\"3\" class=\"lines__number\">Tổng tiền (₫)</th>\n <td class=\"lines__number lines__total\" data-autoid=\"order-total\">{{ total() | sdFormatNumber: 0 }}</td>\n <td></td>\n </tr>\n </tfoot>\n </table>\n </sd-section>\n `,\n styles: `\n .lines {\n width: 100%;\n border-collapse: collapse;\n }\n .lines th,\n .lines td {\n padding: 4px 8px;\n text-align: left;\n vertical-align: top;\n }\n .lines thead th {\n color: var(--sd-text-secondary);\n font-size: 12px;\n font-weight: 500;\n border-bottom: 1px solid var(--sd-border);\n }\n .lines td:first-child {\n min-width: 240px;\n }\n .lines__number {\n width: 150px;\n text-align: right !important;\n }\n .lines td.lines__number {\n padding-top: 14px;\n }\n .lines tfoot th,\n .lines tfoot td {\n padding-top: 12px;\n border-top: 1px solid var(--sd-border);\n }\n .lines__total {\n font-weight: 500;\n }\n .lines__error {\n color: var(--sd-error, currentColor);\n font-size: 12px;\n }\n `,\n})\nexport class LinesFormComponent {\n readonly #productService = inject(ProductService);\n readonly form = input.required<OrderForm>();\n /** Dòng ban đầu (cập nhật) hoặc một dòng trống (tạo mới). */\n readonly seed = input.required<readonly OrderLineDto[]>();\n /** Lỗi theo field do API trả về, khoá dạng `lines.<index>.<field>`. */\n readonly errors = input<Readonly<Record<string, string>>>({});\n readonly #array = new FormArray<FormGroup>([]);\n readonly #version = signal(0);\n #nextKey = 0;\n protected readonly rows = signal<readonly LineRow[]>([]);\n protected readonly amounts = computed(() => {\n this.#version();\n return this.rows().map(\n row => Number(row.group.get('quantity')?.value ?? row.seed.quantity) * Number(row.group.get('unitPrice')?.value ?? row.seed.unitPrice)\n );\n });\n protected readonly total = computed(() => this.amounts().reduce((sum, amount) => sum + amount, 0));\n\n constructor() {\n const subscription = this.#array.valueChanges.subscribe(() => this.#version.update(version => version + 1));\n inject(DestroyRef).onDestroy(() => subscription.unsubscribe());\n // why: trang cập nhật được dùng lại khi chỉ đổi `:id`; dòng hàng phải theo đơn mới, không giữ dòng của đơn trước.\n effect(() => {\n const seed = this.seed();\n untracked(() => this.#load(seed));\n });\n }\n\n protected add(): void {\n this.#push({ productId: '', quantity: 1, unitPrice: 0 });\n }\n\n protected remove(row: LineRow): void {\n const index = this.rows().indexOf(row);\n if (index < 0) return;\n // why: đánh dấu đã sửa TRƯỚC khi gỡ, để dirty theo giá trị so với danh sách dòng lúc trước.\n this.#array.markAsDirty();\n this.#array.removeAt(index);\n this.rows.update(rows => rows.filter(item => item !== row));\n }\n\n /** Chọn sản phẩm thì điền đơn giá hiện hành của sản phẩm. */\n protected async pick(row: LineRow, productId: string | null | undefined): Promise<void> {\n if (!productId) return;\n const product = await firstValueFrom(this.#productService.cachedDetail(productId));\n row.group.get('unitPrice')?.setValue(product.price);\n }\n\n #load(seed: readonly OrderLineDto[]): void {\n this.#array.clear();\n this.rows.set([]);\n (seed.length ? seed : [{ productId: '', quantity: 1, unitPrice: 0 }]).forEach(line => this.#push(line));\n if (this.form().get('lines') !== this.#array) this.form().setControl('lines', this.#array);\n }\n\n #push(seed: OrderLineDto): void {\n const group = new FormGroup({});\n this.#array.push(group);\n this.rows.update(rows => [...rows, { key: this.#nextKey++, group, seed }]);\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAWA;;;AAGG;MA6BU,uBAAuB,CAAA;AACzB,IAAA,gBAAgB,GAAG,MAAM,CAAC,eAAe,CAAC;AAC1C,IAAA,IAAI,GAAG,KAAK;wFAAa;IACzB,IAAI,GAAG,KAAK,CAAC,YAAY;6EAAC;IAC1B,KAAK,GAAG,KAAK,CAAqB,YAAY;8EAAC;IAC/C,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AACxD,IAAA,MAAM,GAAG,KAAK;0FAAU;AACxB,IAAA,KAAK,GAAG,KAAK;yFAA6B;AAEhC,IAAA,MAAM,GAAG,OAAO,GAAgB,KAA4B;AAC7E,QAAA,IAAI,GAAG,CAAC,IAAI,KAAK,OAAO,EAAE;AACxB,YAAA,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,KAAmB,CAAC,CAAC,EAAE,CAAC;YACnG,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,IAAI,cAAc,CAAC,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC3F;AACA,QAAA,MAAM,OAAO,GAA0B,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI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