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