diff --git a/src/app/routes/ticket-management/components/input-invoice/add-cost-detail/add-cost-detail.component.html b/src/app/routes/ticket-management/components/input-invoice/add-cost-detail/add-cost-detail.component.html new file mode 100644 index 00000000..21631163 --- /dev/null +++ b/src/app/routes/ticket-management/components/input-invoice/add-cost-detail/add-cost-detail.component.html @@ -0,0 +1,22 @@ +
+
+ +
+
+ + +
+
+ + + + {{index+1}} + + + + + \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/input-invoice/add-cost-detail/add-cost-detail.component.less b/src/app/routes/ticket-management/components/input-invoice/add-cost-detail/add-cost-detail.component.less new file mode 100644 index 00000000..36315a59 --- /dev/null +++ b/src/app/routes/ticket-management/components/input-invoice/add-cost-detail/add-cost-detail.component.less @@ -0,0 +1,6 @@ +.expend-options { + max-width: 400px; + position : absolute; + right : 20px; + top : 160px; +} \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/input-invoice/add-cost-detail/add-cost-detail.component.ts b/src/app/routes/ticket-management/components/input-invoice/add-cost-detail/add-cost-detail.component.ts new file mode 100644 index 00000000..3349f133 --- /dev/null +++ b/src/app/routes/ticket-management/components/input-invoice/add-cost-detail/add-cost-detail.component.ts @@ -0,0 +1,110 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema } from '@delon/form'; +import { TicketService } from '../../../services/ticket.service'; + +@Component({ + selector: 'app-add-cost-detail', + templateUrl: './add-cost-detail.component.html', + styleUrls: ['./add-cost-detail.component.less'] +}) +export class AddCostDetailComponent implements OnInit { + selectedData: any[] = []; + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + constructor(public service: TicketService) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value + }); + } + return requestOptions; + }; + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedData = e.checkbox!; + break; + } + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } + + private initSF(): SFSchema { + return { + properties: { + enterpriseName: { + title: '费用单号', + type: 'string', + ui: { + placeholder: '请输入' + } + }, + enterprise2Name: { + title: '订单号', + type: 'string', + ui: { + placeholder: '请输入' + } + }, + contactName: { + title: '费用日期', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd' + } as SFDateWidgetSchema + }, + contac2tName: { + title: '订单日期', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd' + } as SFDateWidgetSchema + }, + mobile: { + type: 'string', + title: '结算客户', + ui: { + widget: 'dict-select', + params: { dictKey: 'refund:apply:status' }, + placeholder: '请选择' + } + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '', index: 'key', type: 'checkbox', width: 60 }, + { title: '序号', render: 'no', width: 60 }, + { title: '费用号', index: 'enterpriseName', width: 120 }, + { title: '费用日期', index: 'contacter', width: 120 }, + { title: '订单号', index: 'mobile', width: 120 }, + { title: '订单日期', index: 'mobile', width: 120 }, + { title: '结算客户', index: 'mobile', width: 120 }, + { title: '费用科目', index: 'mobile', width: 120 }, + { title: '费用金额', index: 'mobile', width: 120 }, + { title: '已收金额', index: 'mobile', width: 120 }, + { title: '未收金额', index: 'mobile', width: 120 }, + { title: '收票金额', render: 'mo1bile', width: 150, fixed: 'right' } + ]; + } +} diff --git a/src/app/routes/ticket-management/components/input-invoice/edit-collection-invoice/edit-collection-invoice.component.html b/src/app/routes/ticket-management/components/input-invoice/edit-collection-invoice/edit-collection-invoice.component.html index d4b69d83..c35c653d 100644 --- a/src/app/routes/ticket-management/components/input-invoice/edit-collection-invoice/edit-collection-invoice.component.html +++ b/src/app/routes/ticket-management/components/input-invoice/edit-collection-invoice/edit-collection-invoice.component.html @@ -14,26 +14,42 @@ [button]="'none'">
- - + +
- -
-
- + + +
+
+ +
+
+ + +
-
- - + + + +
+ +
-
+ + + +
\ No newline at end of file diff --git a/src/app/routes/ticket-management/components/input-invoice/edit-collection-invoice/edit-collection-invoice.component.ts b/src/app/routes/ticket-management/components/input-invoice/edit-collection-invoice/edit-collection-invoice.component.ts index 6cc0e4b2..2b3cd7bf 100644 --- a/src/app/routes/ticket-management/components/input-invoice/edit-collection-invoice/edit-collection-invoice.component.ts +++ b/src/app/routes/ticket-management/components/input-invoice/edit-collection-invoice/edit-collection-invoice.component.ts @@ -1,9 +1,10 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { Router } from '@angular/router'; -import { STComponent, STColumn } from '@delon/abc/st'; +import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; import { NzModalService } from 'ng-zorro-antd/modal'; import { TicketService } from '../../../services/ticket.service'; +import { AddCostDetailComponent } from '../add-cost-detail/add-cost-detail.component'; @Component({ selector: 'app-edit-collection-invoice', @@ -28,6 +29,38 @@ export class EditCollectionInvoiceComponent implements OnInit { ngOnInit(): void {} + beforeReq = (requestOptions: STRequestOptions) => { + if (this.searchSf) { + Object.assign(requestOptions.body, { ...this.searchSf.value }); + } + return requestOptions; + }; + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + } + } + + addCostDetailAction() { + const modal = this.nzModalService.create({ + nzTitle: '添加核销明细', + nzContent: AddCostDetailComponent, + nzWidth: 850, + nzOkText: '保存', + nzOnOk: com => { + return false; + } + }); + modal.afterClose.subscribe(res => { + if (res) { + this.st.load(); + } + }); + } + goBack() { history.go(-1); } @@ -161,17 +194,16 @@ export class EditCollectionInvoiceComponent implements OnInit { private initST(): STColumn[] { return [ { title: '', index: 'key', type: 'checkbox' }, - { title: '收票单号', index: 'no', type: 'link' }, - { title: '网络货运人', index: 'no' }, - { title: '发票日期', index: 'no', type: 'date' }, - { title: '发票号', index: 'callNo' }, - { title: '发票金额', index: 'callNo' }, - { title: '税额', render: 'call1No' }, - { title: '发票类型', render: 'call1N2o' }, - { title: '销售方', index: 'callNo' }, - { title: '创建时间', index: 'updatedAt', type: 'date' }, - { title: '创建人', index: 'updatedAt' }, - { title: '收票状态', index: 'updatedAt' } + { title: '序号', index: 'no', type: 'link' }, + { title: '费用号', index: 'no' }, + { title: '费用日期', index: 'no', type: 'date' }, + { title: '订单号', index: 'callNo' }, + { title: '订单日期', index: 'callNo' }, + { title: '结算客户', render: 'call1No' }, + { title: '费用科目', render: 'call1N2o' }, + { title: '费用金额', index: 'callNo' }, + { title: '收票金额', index: 'updatedAt', type: 'date' }, + { title: '收票税额', index: 'updatedAt' } ]; } } diff --git a/src/app/routes/ticket-management/ticket-management.module.ts b/src/app/routes/ticket-management/ticket-management.module.ts index dda8e9af..5f560411 100644 --- a/src/app/routes/ticket-management/ticket-management.module.ts +++ b/src/app/routes/ticket-management/ticket-management.module.ts @@ -21,6 +21,7 @@ import { InputInvoiceComponent } from './components/input-invoice/input-invoice. import { InputInvoiceDetailComponent } from './components/input-invoice/input-invoice-detail/input-invoice-detail.component'; import { AddCollectionInvoiceModalComponent } from './components/input-invoice/add-collection-invoice-modal/add-collection-invoice-modal.component'; import { EditCollectionInvoiceComponent } from './components/input-invoice/edit-collection-invoice/edit-collection-invoice.component'; +import { AddCostDetailComponent } from './components/input-invoice/add-cost-detail/add-cost-detail.component'; const COMPONENTS: any = [ ETCInvoicedListComponent, @@ -43,7 +44,8 @@ const NOTROUTECOMPONENTS: any = [ RequestedDetailComponent, AddOwnerComponent, AddCartComponent, - AddCollectionInvoiceModalComponent + AddCollectionInvoiceModalComponent, + AddCostDetailComponent ]; @NgModule({ declarations: [...COMPONENTS, ...NOTROUTECOMPONENTS],