edit
This commit is contained in:
		@ -34,27 +34,30 @@
 | 
			
		||||
    <nz-tab nzTitle="待受理" (nzClick)="selectChange('1')"></nz-tab>
 | 
			
		||||
    <nz-tab nzTitle="处理中" (nzClick)="selectChange('2')"></nz-tab>
 | 
			
		||||
    <nz-tab nzTitle="已拒绝" (nzClick)="selectChange('4')"></nz-tab>
 | 
			
		||||
    <nz-tab nzTitle="已完成" (nzClick)="selectChange('3')"></nz-tab>
 | 
			
		||||
    <nz-tab nzTitle="已撤销" (nzClick)="selectChange('5')"></nz-tab>
 | 
			
		||||
    <nz-tab nzTitle="已受理" (nzClick)="selectChange('3')"></nz-tab>
 | 
			
		||||
    <nz-tab nzTitle="全部" (nzClick)="selectChange(null)"></nz-tab>
 | 
			
		||||
  </nz-tabset>
 | 
			
		||||
  <ng-template #extraTemplate>
 | 
			
		||||
    <div class="d-flex align-items-center" *ngIf="resourceStatus==='1' || resourceStatus==='3' || !resourceStatus">
 | 
			
		||||
    <div class="d-flex align-items-center"
 | 
			
		||||
      *ngIf="resourceStatus==='1'|| resourceStatus==='2' || resourceStatus==='3' || !resourceStatus">
 | 
			
		||||
      <div class="mr-md">
 | 
			
		||||
        已选择
 | 
			
		||||
        <strong class="text-red">{{ selectedRows.length }}</strong> 条数据   开票金额总计
 | 
			
		||||
        <strong class="text-red">{{ totalCallNo }}</strong>
 | 
			
		||||
        <a *ngIf="totalCallNo > 0" (click)="st.clearCheck()" class="ml-lg">清空</a>
 | 
			
		||||
      </div>
 | 
			
		||||
      <button nz-button *ngIf="resourceStatus==='1' || !resourceStatus" (click)="this.batchRequested()">开票审核</button>
 | 
			
		||||
      <!-- <button nz-button (click)="this.rejectAction(selectedRows)">驳回</button>
 | 
			
		||||
            <button nz-button (click)="changePice(selectedRows)">修改地址</button>-->
 | 
			
		||||
      <button nz-button *ngIf="resourceStatus==='1' || !resourceStatus" (click)="this.batchRequested()">批量受理</button>
 | 
			
		||||
      <button nz-button *ngIf="resourceStatus==='1' || !resourceStatus"
 | 
			
		||||
        (click)="this.rejectAction(selectedRows)">驳回</button>
 | 
			
		||||
      <button nz-button *ngIf="resourceStatus !=='4' && resourceStatus !=='5'"
 | 
			
		||||
        (click)="changeAddress(selectedRows)">修改地址</button>
 | 
			
		||||
      <button nz-button *ngIf="resourceStatus==='3' || !resourceStatus" (click)="printOrder(selectedRows)">打印面单</button>
 | 
			
		||||
    </div>
 | 
			
		||||
  </ng-template>
 | 
			
		||||
 | 
			
		||||
  <st #st [data]="service.$api_get_invoice_requested_page" [columns]="columns" [req]="{ process: beforeReq }"
 | 
			
		||||
    [page]="{}" [res]="{  process: afterRes }" [loading]="false" [scroll]="{ x: '1200px' }"
 | 
			
		||||
    (change)="stChange($event)">
 | 
			
		||||
    [page]="{}" [res]="{  process: afterRes }" [loading]="false" [scroll]="{ x: '1200px' }" (change)="stChange($event)">
 | 
			
		||||
    <ng-template st-row="vatappcode" let-item let-index="index" let-column="column">
 | 
			
		||||
      {{ item.vatappcode }} <br />
 | 
			
		||||
      <label class="text-primary">{{item.stsLabel}}</label>
 | 
			
		||||
@ -66,7 +69,8 @@
 | 
			
		||||
  <div nz-row nzGutter="8">
 | 
			
		||||
    <div nz-col nzSpan="24" se-container [labelWidth]="80">
 | 
			
		||||
      <se [col]="1" label="备注" required>
 | 
			
		||||
        <textarea nz-input rows="3" placeholder="请说明驳回原因" style="width: 325px; margin-left: 14px"></textarea>
 | 
			
		||||
        <textarea nz-input rows="3" [(ngModel)]="rejectReason" placeholder="请说明驳回原因"
 | 
			
		||||
          style="width: 325px; margin-left: 14px"></textarea>
 | 
			
		||||
      </se>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
@ -12,6 +12,7 @@ import { NzModalService } from 'ng-zorro-antd/modal';
 | 
			
		||||
import { TicketService } from '../../services/ticket.service';
 | 
			
		||||
import { PrintOrderModalComponent } from './print-order-modal/print-order-modal.component';
 | 
			
		||||
import { RequestedInvoiceModalComponent } from './requested-invoice-modal/requested-invoice-modal.component';
 | 
			
		||||
import { UpdateAddressModalComponent } from './update-address-modal/update-address-modal.component';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'app-invoice-requested',
 | 
			
		||||
@ -33,12 +34,9 @@ export class InvoiceRequestedComponent {
 | 
			
		||||
 | 
			
		||||
  totalCallNo = 0;
 | 
			
		||||
  selectedRows: any[] = [];
 | 
			
		||||
  constructor(
 | 
			
		||||
    public service: TicketService,
 | 
			
		||||
    private nzModalService: NzModalService,
 | 
			
		||||
    private router: Router,
 | 
			
		||||
    public shipperservice: ShipperBaseService
 | 
			
		||||
  ) {}
 | 
			
		||||
 | 
			
		||||
  rejectReason = '';
 | 
			
		||||
  constructor(public service: TicketService, private nzModalService: NzModalService, private router: Router) {}
 | 
			
		||||
 | 
			
		||||
  beforeReq = (requestOptions: STRequestOptions) => {
 | 
			
		||||
    if (this.resourceStatus) {
 | 
			
		||||
@ -73,54 +71,84 @@ export class InvoiceRequestedComponent {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  rejectAction(item: any[]) {
 | 
			
		||||
    this.rejectReason = '';
 | 
			
		||||
    if (item.length <= 0) {
 | 
			
		||||
      this.service.msgSrv.warning('请选择开票申请');
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
    if (item.find(item => item.sts !== '1')) {
 | 
			
		||||
      this.service.msgSrv.warning('请勿选择非待处理订单');
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
    const modal = this.nzModalService.create({
 | 
			
		||||
      nzTitle: '驳回',
 | 
			
		||||
      nzContent: this.rejectModal,
 | 
			
		||||
      nzFooter: [
 | 
			
		||||
        {
 | 
			
		||||
          label: '拒绝',
 | 
			
		||||
          type: 'default',
 | 
			
		||||
          onClick: () => {
 | 
			
		||||
            modal.destroy();
 | 
			
		||||
      nzOkLoading: this.service.http.loading,
 | 
			
		||||
      nzOnOk: () => {
 | 
			
		||||
        if (!this.rejectReason) {
 | 
			
		||||
          this.service.msgSrv.warning('请填写驳回原因');
 | 
			
		||||
          return false;
 | 
			
		||||
        }
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          label: '通过',
 | 
			
		||||
          type: 'primary',
 | 
			
		||||
          onClick: () => {
 | 
			
		||||
            modal.destroy();
 | 
			
		||||
        let ids = item.map(row => row.id);
 | 
			
		||||
        this.service.request(this.service.$api_reject_invoice, ids).subscribe(res => {
 | 
			
		||||
          if (res) {
 | 
			
		||||
            this.service.msgSrv.success('驳回成功');
 | 
			
		||||
            modal.destroy(true);
 | 
			
		||||
          }
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        return false;
 | 
			
		||||
      }
 | 
			
		||||
      ]
 | 
			
		||||
    });
 | 
			
		||||
    modal.afterClose.subscribe(res => {
 | 
			
		||||
      if (res) {
 | 
			
		||||
        this.st.load();
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  changePice(item: any[]) {
 | 
			
		||||
  /**
 | 
			
		||||
   * 修改地址
 | 
			
		||||
   * @param item
 | 
			
		||||
   */
 | 
			
		||||
  changeAddress(item: any[]) {
 | 
			
		||||
    this.rejectReason = '';
 | 
			
		||||
    if (item.length <= 0) {
 | 
			
		||||
      this.service.msgSrv.warning('请选择开票申请');
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
    if (item.find(item => item.sts !== '1')) {
 | 
			
		||||
      this.service.msgSrv.warning('请勿选择非待处理订单');
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
    const modal = this.nzModalService.create({
 | 
			
		||||
      nzTitle: '驳回',
 | 
			
		||||
      nzContent: this.rejectModal,
 | 
			
		||||
      nzFooter: [
 | 
			
		||||
        {
 | 
			
		||||
          label: '拒绝',
 | 
			
		||||
          type: 'default',
 | 
			
		||||
          onClick: () => {
 | 
			
		||||
            modal.destroy();
 | 
			
		||||
      nzTitle: '修改地址',
 | 
			
		||||
      nzContent: UpdateAddressModalComponent,
 | 
			
		||||
      nzOkLoading: this.service.http.loading,
 | 
			
		||||
      nzOnOk: component => {
 | 
			
		||||
        if (!component.sf.valid) {
 | 
			
		||||
          this.service.msgSrv.warning('表单校验错误');
 | 
			
		||||
          return false;
 | 
			
		||||
        }
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          label: '通过',
 | 
			
		||||
          type: 'primary',
 | 
			
		||||
          onClick: () => {
 | 
			
		||||
            modal.destroy();
 | 
			
		||||
        this.service
 | 
			
		||||
          .request(this.service.$api_update_invoice_address, {
 | 
			
		||||
            ...component.sf.value,
 | 
			
		||||
 | 
			
		||||
          })
 | 
			
		||||
          .subscribe(res => {
 | 
			
		||||
            if (res) {
 | 
			
		||||
              this.service.msgSrv.success('修改成功');
 | 
			
		||||
              modal.destroy(true);
 | 
			
		||||
            }
 | 
			
		||||
          });
 | 
			
		||||
 | 
			
		||||
        return false;
 | 
			
		||||
      }
 | 
			
		||||
      ]
 | 
			
		||||
    });
 | 
			
		||||
    modal.afterClose.subscribe(res => {
 | 
			
		||||
      if (res) {
 | 
			
		||||
        this.st.load();
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@ -362,7 +390,7 @@ export class InvoiceRequestedComponent {
 | 
			
		||||
            visibleIf: {
 | 
			
		||||
              expand: (value: boolean) => value
 | 
			
		||||
            },
 | 
			
		||||
            asyncData: () => this.shipperservice.getCRM()
 | 
			
		||||
            asyncData: () => this.service.getCRM()
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
@ -440,14 +468,15 @@ export class InvoiceRequestedComponent {
 | 
			
		||||
        buttons: [
 | 
			
		||||
          { type: 'divider' },
 | 
			
		||||
          {
 | 
			
		||||
            text: '开票<br/>',
 | 
			
		||||
            text: '开票受理<br/>',
 | 
			
		||||
            click: item => this.requestedInvoiceAction(item),
 | 
			
		||||
            iif: item => item.sts === '1'
 | 
			
		||||
          },
 | 
			
		||||
          // {
 | 
			
		||||
          //   text: '驳回<br/>',
 | 
			
		||||
          //   click: item => this.rejectAction([item])
 | 
			
		||||
          // },
 | 
			
		||||
          {
 | 
			
		||||
            text: '驳回申请<br/>',
 | 
			
		||||
            click: item => this.rejectAction([item]),
 | 
			
		||||
            iif: item => item.sts === '1'
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            text: '订单明细<br/>',
 | 
			
		||||
            click: item => this.router.navigate([`/ticket/invoice-requested/detail/${item?.id}`], { queryParams: { sts: item.sts } })
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1 @@
 | 
			
		||||
<sf #sf [schema]="schema" [ui]="{ '*': { spanLabelFixed: 110, span:24 } }" [compact]="true" [button]="'none'"></sf>
 | 
			
		||||
@ -0,0 +1,102 @@
 | 
			
		||||
import { Component, OnInit, ViewChild } from '@angular/core';
 | 
			
		||||
import { SFCascaderWidgetSchema, SFComponent, SFSchema } from '@delon/form';
 | 
			
		||||
import { TicketService } from '../../../services/ticket.service';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'app-update-address-modal',
 | 
			
		||||
  templateUrl: './update-address-modal.component.html',
 | 
			
		||||
  styleUrls: ['./update-address-modal.component.less']
 | 
			
		||||
})
 | 
			
		||||
export class UpdateAddressModalComponent implements OnInit {
 | 
			
		||||
  @ViewChild('sf', { static: false })
 | 
			
		||||
  sf!: SFComponent;
 | 
			
		||||
  schema: SFSchema = this.initSF();
 | 
			
		||||
 | 
			
		||||
  constructor(public service: TicketService) {}
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {}
 | 
			
		||||
 | 
			
		||||
  private initSF(): SFSchema {
 | 
			
		||||
    return {
 | 
			
		||||
      properties: {
 | 
			
		||||
        reciname: {
 | 
			
		||||
          type: 'string',
 | 
			
		||||
          title: '收件人姓名',
 | 
			
		||||
          ui: {
 | 
			
		||||
            placeholder: '请输入'
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        recitel: {
 | 
			
		||||
          type: 'string',
 | 
			
		||||
          title: '联系电话',
 | 
			
		||||
          format: 'mobile',
 | 
			
		||||
          minLength: 1,
 | 
			
		||||
          maxLength: 11,
 | 
			
		||||
          ui: {
 | 
			
		||||
            placeholder: '请输入',
 | 
			
		||||
            errors: { required: '请输入注册电话', format: '手机号格式错误' }
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        provinceCode: { type: 'string', ui: { hidden: true } },
 | 
			
		||||
        provinceName: { type: 'string', ui: { hidden: true } },
 | 
			
		||||
        cityCode: { type: 'string', ui: { hidden: true } },
 | 
			
		||||
        cityName: { type: 'string', ui: { hidden: true } },
 | 
			
		||||
        areaCode: { type: 'string', ui: { hidden: true } },
 | 
			
		||||
        areaName: { type: 'string', ui: { hidden: true } },
 | 
			
		||||
        enterpriseAddressCode: {
 | 
			
		||||
          type: 'number',
 | 
			
		||||
          title: '收件人地区',
 | 
			
		||||
          ui: {
 | 
			
		||||
            grid: { xxl: 13, xl: 18, lg: 24, md: 24 },
 | 
			
		||||
            widget: 'cascader',
 | 
			
		||||
            valueProperty: 'regionCode',
 | 
			
		||||
            placeholder: '请选择',
 | 
			
		||||
            labelProperty: 'name',
 | 
			
		||||
            asyncData: (node: any, index: any) => {
 | 
			
		||||
              return new Promise(resolve => {
 | 
			
		||||
                this.getRegionDetailByCode(node?.regionCode || '').subscribe(
 | 
			
		||||
                  res => {
 | 
			
		||||
                    node.children = res.map((item: any) => ({ ...item, isLeaf: index === 1 }));
 | 
			
		||||
                  },
 | 
			
		||||
                  _ => {},
 | 
			
		||||
                  () => {
 | 
			
		||||
                    resolve();
 | 
			
		||||
                  }
 | 
			
		||||
                );
 | 
			
		||||
              });
 | 
			
		||||
            },
 | 
			
		||||
            selectionChange: (node: any[]) => {
 | 
			
		||||
              console.log(node);
 | 
			
		||||
              
 | 
			
		||||
              if (node?.length > 0) {
 | 
			
		||||
                this.sf.setValue('/provinceCode', node[0]?.regionCode);
 | 
			
		||||
                this.sf.setValue('/provinceName', node[0]?.name);
 | 
			
		||||
                this.sf.setValue('/cityCode', node[1]?.regionCode);
 | 
			
		||||
                this.sf.setValue('/cityName', node[1]?.name);
 | 
			
		||||
                this.sf.setValue('/areaCode', node[2]?.regionCode);
 | 
			
		||||
                this.sf.setValue('/areaName', node[2]?.name);
 | 
			
		||||
              }
 | 
			
		||||
            }
 | 
			
		||||
          } as SFCascaderWidgetSchema
 | 
			
		||||
        },
 | 
			
		||||
        reciaddr: {
 | 
			
		||||
          type: 'string',
 | 
			
		||||
          title: '详细地址',
 | 
			
		||||
          ui: {
 | 
			
		||||
            visibleIf: {
 | 
			
		||||
              expand: (value: boolean) => value
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
      required: ['reciname', 'recitel', 'reciaddr', 'enterpriseAddressCode']
 | 
			
		||||
    };
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /*
 | 
			
		||||
   * 根据地区code查询地区列表
 | 
			
		||||
   */
 | 
			
		||||
  getRegionDetailByCode(regionCode: any) {
 | 
			
		||||
    return this.service.request(this.service.$api_get_region_by_code, { regionCode });
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -23,6 +23,10 @@ export class TicketService extends ShipperBaseService {
 | 
			
		||||
  $api_get_invoice_requested_order_detail = '/api/fcc/ficoVatappBill/getDetailByVatapp';
 | 
			
		||||
  // 删除开票申请订单明细
 | 
			
		||||
  $api_remove_bill = '/api/fcc/ficoVatappBill/deletebatch';
 | 
			
		||||
  // 运营端单个/批量驳回
 | 
			
		||||
  $api_reject_invoice = '/api/fcc/ficoVatappH/rejectInvoiceApple';
 | 
			
		||||
  // 运营端修改开票地址
 | 
			
		||||
  $api_update_invoice_address = '/api/fcc/ficoVatappH/updateInvoiceAddr';
 | 
			
		||||
 | 
			
		||||
  // 运营端销票处理-订单明细页面
 | 
			
		||||
  $api_ficoVatinvHList = '/api/fcc/ficoVatinvH/ficoVatinvHList';
 | 
			
		||||
@ -115,6 +119,9 @@ export class TicketService extends ShipperBaseService {
 | 
			
		||||
  // 下载对账单文件
 | 
			
		||||
  $api_downloadPdf = '/api/fcc/ficoVatappBill/downloadPdf';
 | 
			
		||||
 | 
			
		||||
  // 根据地区code查询列表
 | 
			
		||||
  $api_get_region_by_code = '/api/mdc/pbc/region/getRegionByCode';
 | 
			
		||||
  
 | 
			
		||||
  constructor(public injector: Injector) {
 | 
			
		||||
    super(injector);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@ -25,6 +25,7 @@ import { AddCostDetailComponent } from './components/input-invoice/add-cost-deta
 | 
			
		||||
import { PrintOrderModalComponent } from './components/invoice-requested/print-order-modal/print-order-modal.component';
 | 
			
		||||
import { ExpressInfoComponent } from './components/express-info/express-info.component';
 | 
			
		||||
import { ExpressDetailModalComponent } from './components/express-info/express-detail-modal/express-detail-modal.component';
 | 
			
		||||
import { UpdateAddressModalComponent } from './components/invoice-requested/update-address-modal/update-address-modal.component';
 | 
			
		||||
 | 
			
		||||
const COMPONENTS: any = [
 | 
			
		||||
  ETCInvoicedListComponent,
 | 
			
		||||
@ -51,7 +52,8 @@ const NOTROUTECOMPONENTS: any = [
 | 
			
		||||
  AddCollectionInvoiceModalComponent,
 | 
			
		||||
  AddCostDetailComponent,
 | 
			
		||||
  PrintOrderModalComponent,
 | 
			
		||||
  ExpressDetailModalComponent
 | 
			
		||||
  ExpressDetailModalComponent,
 | 
			
		||||
  UpdateAddressModalComponent
 | 
			
		||||
];
 | 
			
		||||
@NgModule({
 | 
			
		||||
  declarations: [...COMPONENTS, ...NOTROUTECOMPONENTS],
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user