Merge branch 'develop' of https://gitlab.eascs.com/tms-ui/tms-obc-web into develop

This commit is contained in:
wangshiming
2022-01-13 19:25:19 +08:00
4 changed files with 100 additions and 60 deletions

View File

@ -1,4 +1,5 @@
import { query } from '@angular/animations'; import { query } from '@angular/animations';
import { CurrencyPipe } from '@angular/common';
import { Component, OnInit, ViewChild } from '@angular/core'; import { Component, OnInit, ViewChild } from '@angular/core';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st';
@ -13,7 +14,8 @@ import { RequestedInvoiceModalComponent } from './requested-invoice-modal/reques
@Component({ @Component({
selector: 'app-invoice-requested', selector: 'app-invoice-requested',
templateUrl: './invoice-requested.component.html', templateUrl: './invoice-requested.component.html',
styleUrls: ['./invoice-requested.component.less'] styleUrls: ['./invoice-requested.component.less'],
providers: [CurrencyPipe]
}) })
export class InvoiceRequestedComponent implements OnInit { export class InvoiceRequestedComponent implements OnInit {
@ViewChild('st', { static: true }) @ViewChild('st', { static: true })
@ -30,7 +32,12 @@ export class InvoiceRequestedComponent implements OnInit {
totalCallNo = 0; totalCallNo = 0;
selectedRows: any[] = []; selectedRows: any[] = [];
constructor(public service: TicketService, private nzModalService: NzModalService, private router: Router) {} constructor(
public service: TicketService,
private nzModalService: NzModalService,
private router: Router,
private currencyPipe: CurrencyPipe
) {}
ngOnInit(): void {} ngOnInit(): void {}
@ -354,18 +361,42 @@ export class InvoiceRequestedComponent implements OnInit {
private initST(): STColumn[] { private initST(): STColumn[] {
return [ return [
{ title: '', index: 'key', type: 'checkbox' }, { title: '', index: 'key', type: 'checkbox' },
{ title: '申请编号', render: 'vatappcode', width: 150 }, { title: '申请编号', render: 'vatappcode', width: 180 },
{ title: '网络货运人', index: 'ltdName', width: 120 }, { title: '网络货运人', index: 'ltdName', width: 120 },
{ title: '购买方', index: 'projectName', width: 90 }, { title: '购买方', index: 'projectName', width: 90 },
{ title: '订单数', index: 'ordlines', width: 90 }, { title: '订单数', index: 'ordlines', width: 90 },
{ title: '申请金额', index: 'applyAmount', width: 100 }, {
{ title: '运输费', index: 'fjfmoney2', width: 90 }, title: '申请金额',
{ title: '附加费', index: 'fjfmoney', width: 90 }, index: 'applyAmount',
{ title: '已开票金额', index: 'invoicedMoney', width: 120 }, width: 100,
{ title: '开户行', index: 'bankName', width: 90 }, type: 'currency',
{ title: '银行账户', index: 'bankAccount', width: 100 }, format: item => `${this.currencyPipe.transform(item.applyAmount)}`
{ title: '注册地址', index: 'registerAddr', width: 100 }, },
{ title: '注册电话', index: 'registerPhone', width: 100 }, {
title: '运输费',
index: 'fjfmoney2',
width: 90,
type: 'currency',
format: item => `${this.currencyPipe.transform(item.fjfmoney2)}`
},
{
title: '附加费',
index: 'fjfmoney',
width: 90,
type: 'currency',
format: item => `${this.currencyPipe.transform(item.fjfmoney)}`
},
{
title: '已开票金额',
index: 'invoicedMoney',
width: 120,
type: 'currency',
format: item => `${this.currencyPipe.transform(item.invoicedMoney)}`
},
{ title: '开户行', index: 'bankName', width: 160 },
{ title: '银行账户', index: 'bankAccount', width: 140 },
{ title: '注册地址', index: 'registerAddr', width: 140 },
{ title: '注册电话', index: 'registerPhone', width: 120 },
{ title: '服务名称', index: 'vatname', width: 100 }, { title: '服务名称', index: 'vatname', width: 100 },
{ title: '销货清单', index: 'isdetail', width: 100 }, { title: '销货清单', index: 'isdetail', width: 100 },
{ title: '其他要求', index: 'otherremarks', width: 100 }, { title: '其他要求', index: 'otherremarks', width: 100 },

View File

@ -10,4 +10,7 @@
} }
} }
.text-truncate {
white-space: normal;
}
} }

View File

@ -20,43 +20,29 @@ export class RequestedInvoiceModalComponent implements OnInit {
@ViewChild('st', { static: false }) @ViewChild('st', { static: false })
st!: STComponent; st!: STComponent;
columns: STColumn[] = this.initST(); columns: STColumn[] = this.initST();
headerInfo: any;
id: any; id: any;
info = {};
selectedRows: any[] = []; selectedRows: any[] = [];
totalCallNo = 0; constructor(public service: TicketService, private nzModalService: NzModalService, private modal: NzModalRef) {}
constructor(public service: TicketService, private nzModalService: NzModalService,private modal: NzModalRef,) {}
ngOnInit(): void { ngOnInit(): void {}
this.initData()
}
initData() {
this.service.request(this.service.$api_get_invoice_requested_header_detail, { id: this.id }).subscribe(res => {
console.log(res);
if (res) {
this.headerInfo = res;
}
});
}
/** /**
* 移除订单 * 移除订单
* @returns * @returns
*/ */
removeOrder(item: any[]) { removeOrder(item: any[]) {
console.log(item) console.log(item);
this.nzModalService.warning({ this.nzModalService.warning({
nzTitle: '确定从当前批次中移除所有订单?', nzTitle: '确定从当前批次中移除所有订单?',
nzContent: '移除后相关订单可以重新提交开票申请', nzContent: '移除后相关订单可以重新提交开票申请',
nzOnOk: () => { nzOnOk: () => {
// const ids = this.selectedRows.map(order => order.billHId); const ids = this.selectedRows.map(order => order.billHId);
// this.service.request(this.service.$api_remove_bill, ids).subscribe(res => { this.service.request(this.service.$api_remove_bill, ids).subscribe(res => {
// if (res) { if (res) {
// this.service.msgSrv.success('移除成功'); this.service.msgSrv.success('移除成功');
// this.loadHeadInfo(); this.modal.destroy();
// this.st.reload(); }
// } });
// });
} }
}); });
} }
@ -64,7 +50,6 @@ export class RequestedInvoiceModalComponent implements OnInit {
switch (e.type) { switch (e.type) {
case 'checkbox': case 'checkbox':
this.selectedRows = e.checkbox!; this.selectedRows = e.checkbox!;
this.totalCallNo = this.selectedRows.reduce((total, cv) => total + cv.callNo, 0);
break; break;
case 'filter': case 'filter':
this.st.load(); this.st.load();
@ -74,17 +59,17 @@ export class RequestedInvoiceModalComponent implements OnInit {
private initST(): STColumn[] { private initST(): STColumn[] {
return [ return [
{ title: '', index: 'key', type: 'checkbox' }, { title: '', index: 'key', type: 'checkbox' },
{ title: '订单号', index: 'no', width: 150 }, { title: '订单号', index: 'billHCode', width: 150 },
{ title: '订单完成日期', index: 'updatedAt', type: 'date', width: 150 }, { title: '订单完成日期', index: 'billTime', type: 'date', width: 150 },
{ title: '所属项目', index: 'callNo', width: 120 }, { title: '所属项目', index: 'projectIdName', width: 120 },
{ title: '订单类型', index: 'callNo', width: 90 }, { title: '订单类型', index: 'billTypeName', width: 90 },
{ title: '装货地', index: 'callNo', width: 90 }, { title: '装货地', index: 'loadingfrom', width: 150 },
{ title: '卸货地', index: 'callNo', width: 100 }, { title: '卸货地', index: 'loadingto', width: 150 },
{ title: '货物信息', index: 'callNo', width: 90 }, { title: '货物信息', index: 'goodsinfo', width: 150 },
{ title: '承运司机', index: 'callNo', width: 140, format: item => `特朗普</br>13789040523</br>粤GT8419` }, { title: '承运司机', index: 'driverinfo', width: 150 },
{ title: '总费用', index: 'callNo', width: 90 }, { title: '总费用', index: 'vatmoney', width: 90 },
{ title: '运输费', index: 'callNo', width: 90 }, { title: '运输费', index: 'fjfmoney2', width: 90 },
{ title: '附加费', index: 'callNo', width: 90 }, { title: '附加费', index: 'fjfmoney', width: 90 },
{ {
title: '操作', title: '操作',
width: 80, width: 80,
@ -100,15 +85,23 @@ export class RequestedInvoiceModalComponent implements OnInit {
]; ];
} }
saveManage() { saveManage() {
console.log(this.selectedRows) if (this.selectedRows?.length <= 0) {
console.log('11111') this.service.msgSrv.warning('请选择订单');
const params = { return;
ficoVatappBillVOList: this.selectedRows,
id: this.id
} }
const selectedRows = this.selectedRows.map(item => {
delete item._values;
return item;
});
const params = {
ficoVatappBillVOList: selectedRows,
id: this.id
};
this.service.request(this.service.$api_get_applyFicoVatinv, params).subscribe((res: any) => { this.service.request(this.service.$api_get_applyFicoVatinv, params).subscribe((res: any) => {
console.log(res) if (res) {
}) this.service.msgSrv.success('开票成功');
this.modal.destroy(); this.modal.destroy();
}
});
} }
} }

View File

@ -1,3 +1,4 @@
import { CurrencyPipe } from '@angular/common';
import { Component, OnInit, ViewChild } from '@angular/core'; import { Component, OnInit, ViewChild } from '@angular/core';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st';
@ -8,7 +9,8 @@ import { TicketService } from '../../services/ticket.service';
@Component({ @Component({
selector: 'app-invoiced-list', selector: 'app-invoiced-list',
templateUrl: './invoiced-list.component.html', templateUrl: './invoiced-list.component.html',
styleUrls: ['./invoiced-list.component.less'] styleUrls: ['./invoiced-list.component.less'],
providers: [CurrencyPipe]
}) })
export class InvoicedListComponent implements OnInit { export class InvoicedListComponent implements OnInit {
@ViewChild('st', { static: true }) @ViewChild('st', { static: true })
@ -26,7 +28,12 @@ export class InvoicedListComponent implements OnInit {
selectedRows: any[] = []; selectedRows: any[] = [];
totalCallNo = 0; totalCallNo = 0;
constructor(public service: TicketService, private nzModalService: NzModalService, private router: Router) {} constructor(
public service: TicketService,
private nzModalService: NzModalService,
private router: Router,
private currencyPipe: CurrencyPipe
) {}
ngOnInit(): void {} ngOnInit(): void {}
@ -178,10 +185,16 @@ export class InvoicedListComponent implements OnInit {
{ title: '网络货运人', index: 'ltdId', width: 120 }, { title: '网络货运人', index: 'ltdId', width: 120 },
{ title: '购买人', index: 'artoname', width: 90 }, { title: '购买人', index: 'artoname', width: 90 },
{ title: '订单数', index: 'ordlines', width: 90 }, { title: '订单数', index: 'ordlines', width: 90 },
{ title: '价税合计', index: 'vatmoney', width: 100 }, {
{ title: '金额', index: 'vatnotax', width: 90 }, title: '价税合计',
index: 'vatmoney',
width: 100,
type: 'currency',
format: item => `${this.currencyPipe.transform(item.vatmoney)}`
},
{ title: '金额', index: 'vatnotax', width: 90, type: 'currency', format: item => `${this.currencyPipe.transform(item.vatnotax)}` },
{ title: '税率', index: 'vatrate', width: 90 }, { title: '税率', index: 'vatrate', width: 90 },
{ title: '税额', index: 'disvattax', width: 90 }, { title: '税额', index: 'disvattax', width: 90, type: 'currency', format: item => `${this.currencyPipe.transform(item.disvattax) || ''}` },
{ title: '开票日期', index: 'invoicedate', type: 'date', width: 150 }, { title: '开票日期', index: 'invoicedate', type: 'date', width: 150 },
{ {
title: '快递信息', title: '快递信息',