From 358ba2708e7bbda993bf7022d6d280aefe491f7c Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Mon, 27 Dec 2021 13:26:43 +0800 Subject: [PATCH] edit --- .../cost-management-detail.component.html | 7 +- .../cost-management-detail.component.ts | 4 + .../cost-management.component.html | 6 +- .../cost-management.component.ts | 2 +- .../expenses-payable.component.html | 56 +++++++ .../expenses-payable.component.less | 13 ++ .../expenses-payable.component.ts | 149 ++++++++++++++++++ .../expenses-receivable.component.html | 56 +++++++ .../expenses-receivable.component.less | 13 ++ .../expenses-receivable.component.ts | 148 +++++++++++++++++ .../financial-managemen-routing.module.ts | 4 + .../financial-management.module.ts | 6 +- src/assets/mocks/menu-data.json | 10 ++ 13 files changed, 469 insertions(+), 5 deletions(-) create mode 100644 src/app/routes/financial-management/components/cost-management/expenses-payable/expenses-payable.component.html create mode 100644 src/app/routes/financial-management/components/cost-management/expenses-payable/expenses-payable.component.less create mode 100644 src/app/routes/financial-management/components/cost-management/expenses-payable/expenses-payable.component.ts create mode 100644 src/app/routes/financial-management/components/cost-management/expenses-receivable/expenses-receivable.component.html create mode 100644 src/app/routes/financial-management/components/cost-management/expenses-receivable/expenses-receivable.component.less create mode 100644 src/app/routes/financial-management/components/cost-management/expenses-receivable/expenses-receivable.component.ts diff --git a/src/app/routes/financial-management/components/cost-management/cost-management-detail/cost-management-detail.component.html b/src/app/routes/financial-management/components/cost-management/cost-management-detail/cost-management-detail.component.html index 749dabaf..d79d4012 100644 --- a/src/app/routes/financial-management/components/cost-management/cost-management-detail/cost-management-detail.component.html +++ b/src/app/routes/financial-management/components/cost-management/cost-management-detail/cost-management-detail.component.html @@ -1,4 +1,9 @@ - + + + + diff --git a/src/app/routes/financial-management/components/cost-management/cost-management-detail/cost-management-detail.component.ts b/src/app/routes/financial-management/components/cost-management/cost-management-detail/cost-management-detail.component.ts index caf83c83..0f72fa25 100644 --- a/src/app/routes/financial-management/components/cost-management/cost-management-detail/cost-management-detail.component.ts +++ b/src/app/routes/financial-management/components/cost-management/cost-management-detail/cost-management-detail.component.ts @@ -17,6 +17,10 @@ export class CostManagementDetailComponent implements OnInit { ngOnInit(): void {} + goBack() { + history.go(-1); + } + private initST(): { [key: string]: STColumn[] } { return { cost: [ diff --git a/src/app/routes/financial-management/components/cost-management/cost-management.component.html b/src/app/routes/financial-management/components/cost-management/cost-management.component.html index de4bb77b..aec6d0c7 100644 --- a/src/app/routes/financial-management/components/cost-management/cost-management.component.html +++ b/src/app/routes/financial-management/components/cost-management/cost-management.component.html @@ -24,8 +24,10 @@
- - + +
diff --git a/src/app/routes/financial-management/components/cost-management/cost-management.component.ts b/src/app/routes/financial-management/components/cost-management/cost-management.component.ts index 961744fe..d5df3c94 100644 --- a/src/app/routes/financial-management/components/cost-management/cost-management.component.ts +++ b/src/app/routes/financial-management/components/cost-management/cost-management.component.ts @@ -258,7 +258,7 @@ export class CostManagementComponent implements OnInit { }, { text: '修改', - click: item => this.router.navigate(['/financial-management/freight-account/detail/1']) + click: item => this.router.navigate(['/financial-management/cost-management/expenses-receivable/1'], { queryParams: { id: 1 } }) } ] } diff --git a/src/app/routes/financial-management/components/cost-management/expenses-payable/expenses-payable.component.html b/src/app/routes/financial-management/components/cost-management/expenses-payable/expenses-payable.component.html new file mode 100644 index 00000000..e934f2da --- /dev/null +++ b/src/app/routes/financial-management/components/cost-management/expenses-payable/expenses-payable.component.html @@ -0,0 +1,56 @@ + + + + + + + + + + + +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/src/app/routes/financial-management/components/cost-management/expenses-payable/expenses-payable.component.less b/src/app/routes/financial-management/components/cost-management/expenses-payable/expenses-payable.component.less new file mode 100644 index 00000000..23d2c4ba --- /dev/null +++ b/src/app/routes/financial-management/components/cost-management/expenses-payable/expenses-payable.component.less @@ -0,0 +1,13 @@ +:host::ng-deep { + + .content-box { + .ant-card-body { + padding-top: 14px; + } + } + + nz-range-picker { + width: 100%; + } + +} \ No newline at end of file diff --git a/src/app/routes/financial-management/components/cost-management/expenses-payable/expenses-payable.component.ts b/src/app/routes/financial-management/components/cost-management/expenses-payable/expenses-payable.component.ts new file mode 100644 index 00000000..343d89d1 --- /dev/null +++ b/src/app/routes/financial-management/components/cost-management/expenses-payable/expenses-payable.component.ts @@ -0,0 +1,149 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { STComponent, STColumn } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { FreightAccountService } from '../../../services/freight-account.service'; + +@Component({ + selector: 'app-expenses-payable', + templateUrl: './expenses-payable.component.html', + styleUrls: ['./expenses-payable.component.less'] +}) +export class ExpensesPayableComponent implements OnInit { + + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + schema!: SFSchema; + columns: STColumn[] = this.initST(); + + id = null; + data: any[] = [ + { + id: 1, + description1: '', + description2: '', + description3: '', + num: null, + description5: '' + } + ]; + + constructor(public service: FreightAccountService, private route: ActivatedRoute) { + this.id = route.snapshot.queryParams.id; + if (this.id) { + this.schema = this.initSF({ page2: '天津怡亚通物流科技有限公司', pag2e21: '茅台集团' }); + } else { + this.schema = this.initSF(); + } + } + + ngOnInit(): void {} + + addRow() { + this.data.push({ + id: this.data.length + 1, + description1: '', + description2: '', + description3: '', + num: null, + description5: '' + }); + this.st.reload(); + } + + goBack() { + history.go(-1); + } + + private initSF(data?: any): SFSchema { + return { + properties: { + page2: { + type: 'string', + title: '网络货运人', + enum: [], + ui: { + widget: data ? 'text' : 'select', + placeholder: '请选择' + }, + default: data?.page2 || '' + }, + pag2e21: { + title: '应付对象', + type: 'string', + enum: [], + ui: { + widget: data ? 'text' : 'select', + placeholder: '请选择' + }, + default: data?.pag2e21 || '' + }, + dee: { + title: '', + type: 'string', + ui: { + widget: 'text' + }, + default: ' ' + }, + createTi2me: { + title: '费用日期', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd' + } as SFDateWidgetSchema, + default: data?.createTi2me || '' + }, + pa2ge2: { + type: 'string', + title: '收票方式', + enum: [], + ui: { + widget: 'select', + placeholder: '请选择' + }, + default: data?.pa2ge2 || '' + }, + page: { + type: 'string', + title: '应付备注', + ui: { + placeholder: '请输入' + }, + default: data?.page || '' + } + }, + required: ['page2', 'pag2e21', 'createTi2me', 'pa2ge2'] + }; + } + + private initST(): STColumn[] { + return [ + { title: '结算客户', render: 'description1', width: 150 }, + { title: '费用科目', render: 'description2', width: 120 }, + { title: '税率', render: 'description3', width: 120 }, + { title: '应付金额', render: 'num', width: 120 }, + { title: '备注', render: 'description5', width: 150 }, + { + title: '操作', + fixed: 'right', + className: 'text-center', + width: 90, + buttons: [ + { + text: '删除', + click: item => { + this.st.removeRow(item); + this.data = this.data.filter(i => i.id !== item.id); + console.log(this.st.data, this.st._data); + } + } + ] + } + ]; + } +} diff --git a/src/app/routes/financial-management/components/cost-management/expenses-receivable/expenses-receivable.component.html b/src/app/routes/financial-management/components/cost-management/expenses-receivable/expenses-receivable.component.html new file mode 100644 index 00000000..83649ca4 --- /dev/null +++ b/src/app/routes/financial-management/components/cost-management/expenses-receivable/expenses-receivable.component.html @@ -0,0 +1,56 @@ + + + + + + + + + + + +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/src/app/routes/financial-management/components/cost-management/expenses-receivable/expenses-receivable.component.less b/src/app/routes/financial-management/components/cost-management/expenses-receivable/expenses-receivable.component.less new file mode 100644 index 00000000..23d2c4ba --- /dev/null +++ b/src/app/routes/financial-management/components/cost-management/expenses-receivable/expenses-receivable.component.less @@ -0,0 +1,13 @@ +:host::ng-deep { + + .content-box { + .ant-card-body { + padding-top: 14px; + } + } + + nz-range-picker { + width: 100%; + } + +} \ No newline at end of file diff --git a/src/app/routes/financial-management/components/cost-management/expenses-receivable/expenses-receivable.component.ts b/src/app/routes/financial-management/components/cost-management/expenses-receivable/expenses-receivable.component.ts new file mode 100644 index 00000000..ecb50ca6 --- /dev/null +++ b/src/app/routes/financial-management/components/cost-management/expenses-receivable/expenses-receivable.component.ts @@ -0,0 +1,148 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema } from '@delon/form'; +import { FreightAccountService } from '../../../services/freight-account.service'; + +@Component({ + selector: 'app-expenses-receivable', + templateUrl: './expenses-receivable.component.html', + styleUrls: ['./expenses-receivable.component.less'] +}) +export class ExpensesReceivableComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + schema!: SFSchema; + columns: STColumn[] = this.initST(); + + id = null; + data: any[] = [ + { + id: 1, + description1: '', + description2: '', + description3: '', + num: null, + description5: '' + } + ]; + + constructor(public service: FreightAccountService, private route: ActivatedRoute) { + this.id = route.snapshot.queryParams.id; + if (this.id) { + this.schema = this.initSF({ page2: '天津怡亚通物流科技有限公司', pag2e21: '茅台集团' }); + } else { + this.schema = this.initSF(); + } + } + + ngOnInit(): void {} + + addRow() { + this.data.push({ + id: this.data.length + 1, + description1: '', + description2: '', + description3: '', + num: null, + description5: '' + }); + this.st.reload(); + } + + goBack() { + history.go(-1); + } + + private initSF(data?: any): SFSchema { + return { + properties: { + page2: { + type: 'string', + title: '网络货运人', + enum: [], + ui: { + widget: data ? 'text' : 'select', + placeholder: '请选择' + }, + default: data?.page2 || '' + }, + pag2e21: { + title: '应收对象', + type: 'string', + enum: [], + ui: { + widget: data ? 'text' : 'select', + placeholder: '请选择' + }, + default: data?.pag2e21 || '' + }, + dee: { + title: '', + type: 'string', + ui: { + widget: 'text' + }, + default: ' ' + }, + createTi2me: { + title: '费用日期', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd' + } as SFDateWidgetSchema, + default: data?.createTi2me || '' + }, + pa2ge2: { + type: 'string', + title: '开票方式', + enum: [], + ui: { + widget: 'select', + placeholder: '请选择' + }, + default: data?.pa2ge2 || '' + }, + page: { + type: 'string', + title: '应收备注', + ui: { + placeholder: '请输入' + }, + default: data?.page || '' + } + }, + required: ['page2', 'pag2e21', 'createTi2me', 'pa2ge2'] + }; + } + + private initST(): STColumn[] { + return [ + { title: '结算客户', render: 'description1', width: 150 }, + { title: '费用科目', render: 'description2', width: 120 }, + { title: '税率', render: 'description3', width: 120 }, + { title: '应收金额', render: 'num', width: 120 }, + { title: '备注', render: 'description5', width: 150 }, + { + title: '操作', + fixed: 'right', + className: 'text-center', + width: 90, + buttons: [ + { + text: '删除', + click: item => { + this.st.removeRow(item); + this.data = this.data.filter(i => i.id !== item.id); + console.log(this.st.data, this.st._data); + } + } + ] + } + ]; + } +} diff --git a/src/app/routes/financial-management/financial-managemen-routing.module.ts b/src/app/routes/financial-management/financial-managemen-routing.module.ts index d1356f30..46052c12 100644 --- a/src/app/routes/financial-management/financial-managemen-routing.module.ts +++ b/src/app/routes/financial-management/financial-managemen-routing.module.ts @@ -12,6 +12,8 @@ import { AbnormalGoldComponent } from './components/abnormal-gold/abnormal-gold. import { PaymentRecordComponent } from './components/payment-record/payment-record.component'; import { TransactionFlowComponent } from './components/transaction-flow/transaction-flow.component'; import { CostManagementDetailComponent } from './components/cost-management/cost-management-detail/cost-management-detail.component'; +import { ExpensesReceivableComponent } from './components/cost-management/expenses-receivable/expenses-receivable.component'; +import { ExpensesPayableComponent } from './components/cost-management/expenses-payable/expenses-payable.component'; const routes: Routes = [ { path: 'freight-account', component: FreightAccountComponent }, @@ -25,6 +27,8 @@ const routes: Routes = [ // { path: 'voucher-summary', component: VoucherSummaryComponent }, { path: 'cost-management', component: CostManagementComponent }, { path: 'cost-management/detail/:id', component: CostManagementDetailComponent }, + { path: 'cost-management/expenses-receivable/:id', component: ExpensesReceivableComponent }, + { path: 'cost-management/expenses-payable/:id', component: ExpensesPayableComponent }, { path: 'abnormal-gold', component: AbnormalGoldComponent }, { path: 'payment-record', component: PaymentRecordComponent }, { path: 'transaction-flow', component: TransactionFlowComponent }, diff --git a/src/app/routes/financial-management/financial-management.module.ts b/src/app/routes/financial-management/financial-management.module.ts index dbd19f99..86f03925 100644 --- a/src/app/routes/financial-management/financial-management.module.ts +++ b/src/app/routes/financial-management/financial-management.module.ts @@ -16,6 +16,8 @@ import { PaymentRecordComponent } from './components/payment-record/payment-reco import { TransactionFlowComponent } from './components/transaction-flow/transaction-flow.component'; import { ClearingModalComponent } from './components/abnormal-gold/clearing-modal/clearing-modal.component'; import { CostManagementDetailComponent } from './components/cost-management/cost-management-detail/cost-management-detail.component'; +import { ExpensesReceivableComponent } from './components/cost-management/expenses-receivable/expenses-receivable.component'; +import { ExpensesPayableComponent } from './components/cost-management/expenses-payable/expenses-payable.component'; const ROUTESCOMPONENTS = [ FreightAccountComponent, @@ -27,7 +29,9 @@ const ROUTESCOMPONENTS = [ PaymentRecordComponent, TransactionFlowComponent, CostManagementComponent, - CostManagementDetailComponent + CostManagementDetailComponent, + ExpensesReceivableComponent, + ExpensesPayableComponent ]; const NOTROUTECOMPONENTS = [DriverAccountDetailComponent, FreightAccountDetailComponent, SettingFinancialComponent, ClearingModalComponent]; diff --git a/src/assets/mocks/menu-data.json b/src/assets/mocks/menu-data.json index 06346d03..3410dea1 100644 --- a/src/assets/mocks/menu-data.json +++ b/src/assets/mocks/menu-data.json @@ -260,6 +260,16 @@ "hide": true, "link": "/financial-management/cost-management/detail/:id" }, + { + "text": "应收费用单", + "hide": true, + "link": "/financial-management/cost-management/expenses-receivable/:id" + }, + { + "text": "应付费用单", + "hide": true, + "link": "/financial-management/cost-management/expenses-payable/:id" + }, { "text": "货主账户", "link": "/financial-management/freight-account"