发票上传
This commit is contained in:
		@ -0,0 +1,96 @@
 | 
			
		||||
<page-header-wrapper [title]="''"></page-header-wrapper>
 | 
			
		||||
 | 
			
		||||
<nz-card>
 | 
			
		||||
  <!-- 搜索表单 -->
 | 
			
		||||
  <div nz-row nzGutter="8">
 | 
			
		||||
    <div nz-col [nzSpan]="_$expand ? 24 : 18">
 | 
			
		||||
      <sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div nz-col [nzSpan]="_$expand ? 24 : 6" [class.text-right]="_$expand">
 | 
			
		||||
      <button nz-button nzType="primary" [disabled]="!sf.valid" [nzLoading]="isLoading && st.loading" (click)="search()" >查询</button>
 | 
			
		||||
      <button nz-button (click)="resetSF()">重置</button>
 | 
			
		||||
      <button nz-button (click)="resetSF()">导出</button>
 | 
			
		||||
      <button nz-button nzType="link" (click)="expandToggle()">
 | 
			
		||||
        {{ !_$expand ? '展开' : '收起' }}
 | 
			
		||||
        <i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
 | 
			
		||||
      </button>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</nz-card>
 | 
			
		||||
<nz-card>
 | 
			
		||||
  <nz-tabset [nzTabBarExtraContent]="extraTemplate" *ngIf="tabs.length>0">
 | 
			
		||||
 | 
			
		||||
    <nz-tab *ngFor="let tab of tabs" [nzTitle]="tab.name" (nzSelect)="selectChange(tab)">
 | 
			
		||||
    </nz-tab>
 | 
			
		||||
  </nz-tabset>
 | 
			
		||||
  <!-- 数据列表 -->
 | 
			
		||||
  <st #st [scroll]="{x:'1200px'}" [data]="service.$api_getTaxOrderPage_page" [columns]="columns"
 | 
			
		||||
    [req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
 | 
			
		||||
    [res]="{ reName: { list: 'data.records', total: 'data.total' } }"
 | 
			
		||||
    [page]="{ show: true, showSize: true, pageSizes: [10,20, 50, 100] }" [loading]="service.http.loading">
 | 
			
		||||
    <ng-template st-row="putStatus" let-item let-index="index">
 | 
			
		||||
      <!-- <a (click)="viewAuditResult(item)" *ngIf="item?.billStatus === '2'">{{item?.billStatusLabel}}</a> -->
 | 
			
		||||
      <span *ngIf="item?.putStatus == '0'">待上传</span>
 | 
			
		||||
      <span *ngIf="item?.putStatus == '1'">已上传</span>
 | 
			
		||||
      <span *ngIf="item?.putStatus == '3'">上传中</span>
 | 
			
		||||
      <span  *ngIf="item?.putStatus == '2'" style="color: red;" (click)="unnormal(item)">上传异常</span>
 | 
			
		||||
 | 
			
		||||
    </ng-template>
 | 
			
		||||
    <ng-template st-row="checkStatus" let-item let-index="index">
 | 
			
		||||
      <!-- <a (click)="viewAuditResult(item)" *ngIf="item?.billStatus === '2'">{{item?.billStatusLabel}}</a> -->
 | 
			
		||||
      <span *ngIf="item?.checkStatus == '0'">校验中</span>
 | 
			
		||||
      <span *ngIf="item?.checkStatus == '1'">通过</span>
 | 
			
		||||
      <!-- <span  *ngIf="item?.checkStatus == '2'" style="color: red;" (click)="unnormal(item)">不通过</span> -->
 | 
			
		||||
      <span  *ngIf="item?.checkStatus == '2'" style="color: red;" (click)="viewResult(item)">不通过</span>
 | 
			
		||||
 | 
			
		||||
    </ng-template>
 | 
			
		||||
    <ng-template st-row="driverName" let-item let-index="index">
 | 
			
		||||
      <div> {{ item?.driverName }}{{  item?.driverPhone ? "/" + item?.driverPhone : '' }} </div>
 | 
			
		||||
    </ng-template>
 | 
			
		||||
    <!-- <ng-template st-row="localValid" let-item let-index="index">
 | 
			
		||||
      <a (click)="viewResult(item)" *ngIf="item?.billStatus === '2'">{{item?.billStatusLabel}}</a>
 | 
			
		||||
      <span *ngIf="item?.billStatus !== '2'">{{item?.billStatusLabel}}</span>
 | 
			
		||||
    </ng-template> -->
 | 
			
		||||
    <ng-template st-row="loadingPicture" let-item let-index="index">
 | 
			
		||||
      <div class="imgBox">
 | 
			
		||||
        <div *ngIf="item.loadingPicture">
 | 
			
		||||
          <app-imagelist style="width: 60px" [imgList]="[item.loadingPicture]"> </app-imagelist>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </ng-template>
 | 
			
		||||
    <ng-template st-row="unloadPicture" let-item let-index="index">
 | 
			
		||||
      <div class="imgBox">
 | 
			
		||||
        <div *ngIf="item.unloadPicture">
 | 
			
		||||
          <app-imagelist style="width: 40px" [imgList]="[item.unloadPicture]"> </app-imagelist>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </ng-template>
 | 
			
		||||
    <ng-template st-row="loadingLadingBill" let-item let-index="index">
 | 
			
		||||
      <div class="imgBox">
 | 
			
		||||
        <div *ngIf="item.loadingLadingBill">
 | 
			
		||||
          <app-imagelist style="width: 40px" [imgList]="[item.loadingLadingBill]"> </app-imagelist>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </ng-template>
 | 
			
		||||
    <ng-template st-row="signatureForm" let-item let-index="index">
 | 
			
		||||
      <div class="imgBox">
 | 
			
		||||
        <div *ngIf="item.signatureForm">
 | 
			
		||||
          <app-imagelist style="width: 40px" [imgList]="[item.signatureForm]"> </app-imagelist>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </ng-template>
 | 
			
		||||
    <ng-template st-row="orderAmount" let-item let-index="index">
 | 
			
		||||
      <div class="text-right">{{item?.orderAmount | currency }}</div>
 | 
			
		||||
    </ng-template>
 | 
			
		||||
  </st>
 | 
			
		||||
</nz-card>
 | 
			
		||||
<ng-template #extraTemplate>
 | 
			
		||||
  <div class="d-flex align-items-center">
 | 
			
		||||
    <div class="mr-md">
 | 
			
		||||
      已选择
 | 
			
		||||
      <strong class="text-red">{{ selectedRows.length }}</strong> 条数据
 | 
			
		||||
    </div>
 | 
			
		||||
    <button *ngIf="selectedIndex === '0' || selectedIndex === '2'" nz-button nzType="primary" (click)="upload()">上传</button>
 | 
			
		||||
    <button *ngIf="selectedIndex === '1' || selectedIndex === '3'" nz-button nzType="primary" (click)="recall()">撤回</button>
 | 
			
		||||
  </div>
 | 
			
		||||
</ng-template>
 | 
			
		||||
@ -0,0 +1,22 @@
 | 
			
		||||
:host {
 | 
			
		||||
  .text-black {
 | 
			
		||||
    color: #000;
 | 
			
		||||
  }
 | 
			
		||||
  .icon {
 | 
			
		||||
    display: inline-block;
 | 
			
		||||
    width: 1em;
 | 
			
		||||
    height: 1em;
 | 
			
		||||
    stroke-width: 0;
 | 
			
		||||
    stroke: currentColor;
 | 
			
		||||
    /* stylelint-disable-next-line order/properties-order */
 | 
			
		||||
    fill: currentColor;
 | 
			
		||||
  }
 | 
			
		||||
  ::ng-deep {
 | 
			
		||||
    .imgBox {
 | 
			
		||||
      display: flex;
 | 
			
		||||
      img {
 | 
			
		||||
          width: 60px !important; 
 | 
			
		||||
      }
 | 
			
		||||
  }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,459 @@
 | 
			
		||||
import { Component, OnInit, ViewChild } from '@angular/core';
 | 
			
		||||
import { ActivatedRoute, Router } from '@angular/router';
 | 
			
		||||
import { STColumn, STComponent, STData } from '@delon/abc/st';
 | 
			
		||||
import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
 | 
			
		||||
import { ShipperBaseService } from '@shared';
 | 
			
		||||
import { NzModalService } from 'ng-zorro-antd/modal';
 | 
			
		||||
import { of } from 'rxjs';
 | 
			
		||||
import { map } from 'rxjs/operators';
 | 
			
		||||
import { TaxManagementService } from '../../services/tax-management.service';
 | 
			
		||||
import { TaxManagementInvoiceUploadSettingComponent } from './upload-setting/upload-setting.component';
 | 
			
		||||
import { TaxManagementInvoiceVerifyResultComponent } from './verify-result/verify-result.component';
 | 
			
		||||
// import { DatatableReportingUploadSettingComponent } from '../upload-setting/upload-setting.component';
 | 
			
		||||
// import { DatatableReportingVerifyResultComponent } from '../verify-result/verify-result.component';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'app-tax-management-invoice-reporting',
 | 
			
		||||
  templateUrl: './invoice-reporting.component.html',
 | 
			
		||||
  styleUrls: ['./invoice-reporting.component.less']
 | 
			
		||||
})
 | 
			
		||||
export class TaxManagementInvoiceReportingComponent implements OnInit {
 | 
			
		||||
  _$expand = false;
 | 
			
		||||
  ui!: SFUISchema;
 | 
			
		||||
  schema!: SFSchema;
 | 
			
		||||
  columns!: STColumn[];
 | 
			
		||||
  @ViewChild('st', { static: false }) st!: STComponent;
 | 
			
		||||
  @ViewChild('sf', { static: false }) sf!: SFComponent;
 | 
			
		||||
  tabType!: string;
 | 
			
		||||
  isLoading: boolean = false;
 | 
			
		||||
  tabs: any[] = [
 | 
			
		||||
    { name: '待上传', value: '0' },
 | 
			
		||||
    { name: '上传中', value: '3' },
 | 
			
		||||
    { name: '已上传', value: '1' },
 | 
			
		||||
    { name: '异常', value: '2' },
 | 
			
		||||
    { name: '全部', value: '' }
 | 
			
		||||
  ];
 | 
			
		||||
  selectedIndex = '0'; //选择的项目
 | 
			
		||||
  serviceTel = '';
 | 
			
		||||
  constructor(
 | 
			
		||||
    public service: TaxManagementService,
 | 
			
		||||
    private router: Router,
 | 
			
		||||
    private ar: ActivatedRoute,
 | 
			
		||||
    public shipperservice: ShipperBaseService,
 | 
			
		||||
    private modal: NzModalService,
 | 
			
		||||
    public shipperSrv: ShipperBaseService
 | 
			
		||||
  ) {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * 查询字段个数
 | 
			
		||||
   */
 | 
			
		||||
  get queryFieldCount(): number {
 | 
			
		||||
    return Object.keys(this.schema?.properties || {}).length;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * 查询参数
 | 
			
		||||
   */
 | 
			
		||||
  get reqParams() {
 | 
			
		||||
    const params = Object.assign({}, this.sf?.value || {}, {
 | 
			
		||||
      putStatus: this.selectedIndex,
 | 
			
		||||
    });
 | 
			
		||||
    delete params._$expand;
 | 
			
		||||
    return { ...params };
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * 选中行
 | 
			
		||||
   */
 | 
			
		||||
  get selectedRows() {
 | 
			
		||||
    return this.st?.list.filter((item: any) => item.checked) || [];
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * 伸缩查询条件
 | 
			
		||||
   */
 | 
			
		||||
  expandToggle() {
 | 
			
		||||
    this._$expand = !this._$expand;
 | 
			
		||||
    this.sf?.setValue('/_$expand', this._$expand);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * 重置表单
 | 
			
		||||
   */
 | 
			
		||||
  resetSF() {
 | 
			
		||||
    this.sf.reset();
 | 
			
		||||
    this._$expand = false;
 | 
			
		||||
    this.isLoading = true
 | 
			
		||||
  }
 | 
			
		||||
  /**
 | 
			
		||||
   * 程序初始化入口
 | 
			
		||||
   */
 | 
			
		||||
  ngOnInit() {
 | 
			
		||||
    this.initSF();
 | 
			
		||||
    this.initST();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * 初始化查询表单
 | 
			
		||||
   */
 | 
			
		||||
  initSF() {
 | 
			
		||||
    this.schema = {
 | 
			
		||||
      properties: {
 | 
			
		||||
        _$expand: { type: 'boolean', ui: { hidden: true } },
 | 
			
		||||
        putStatus: {
 | 
			
		||||
          title: '上传状态',
 | 
			
		||||
          type: 'string',
 | 
			
		||||
          default: 0,
 | 
			
		||||
          enum: [
 | 
			
		||||
            { label: '全部', value: 0 },
 | 
			
		||||
            { label: '待上传', value: 1 },
 | 
			
		||||
            { label: '上传中', value: 2 },
 | 
			
		||||
            { label: '已上传', value: 3 },
 | 
			
		||||
            { label: '异常', value: 4 }
 | 
			
		||||
          ],
 | 
			
		||||
 | 
			
		||||
          ui: {
 | 
			
		||||
            placeholder: '请选择',
 | 
			
		||||
            widget: 'select',
 | 
			
		||||
            allowClear: true
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        networkTransporter: {
 | 
			
		||||
          type: 'string',
 | 
			
		||||
          title: '网络货运人',
 | 
			
		||||
          ui: {
 | 
			
		||||
            widget: 'select',
 | 
			
		||||
            placeholder: '请选择',
 | 
			
		||||
            allowClear: true,
 | 
			
		||||
            asyncData: () => this.shipperservice.getNetworkFreightForwarder()
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        hrto: {
 | 
			
		||||
          type: 'string',
 | 
			
		||||
          title: '购买方',
 | 
			
		||||
          ui: {
 | 
			
		||||
            widget: 'select',
 | 
			
		||||
            placeholder: '请选择',
 | 
			
		||||
            allowClear: true,
 | 
			
		||||
            asyncData: () => this.service.getCRMCustomerId()
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        billCode: {
 | 
			
		||||
          title: '订单号', type: 'string', ui: {
 | 
			
		||||
            placeholder: '请输入', visibleIf: {
 | 
			
		||||
              _$expand: (value: boolean) => value
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        recentlyPutTime: {
 | 
			
		||||
          title: '开票日期',
 | 
			
		||||
          type: 'string',
 | 
			
		||||
          ui: {
 | 
			
		||||
            widget: 'sl-from-to',
 | 
			
		||||
            type: 'date',
 | 
			
		||||
            format: 'yyyy-MM-dd',
 | 
			
		||||
            visibleIf: {
 | 
			
		||||
              _$expand: (value: boolean) => value,
 | 
			
		||||
            },
 | 
			
		||||
          } as SFDateWidgetSchema,
 | 
			
		||||
        },
 | 
			
		||||
        orderPayTime: {
 | 
			
		||||
          title: '上传日期',
 | 
			
		||||
          type: 'string',
 | 
			
		||||
          ui: {
 | 
			
		||||
            widget: 'sl-from-to',
 | 
			
		||||
            type: 'date',
 | 
			
		||||
            format: 'yyyy-MM-dd',
 | 
			
		||||
            visibleIf: {
 | 
			
		||||
              _$expand: (value: boolean) => value,
 | 
			
		||||
            },
 | 
			
		||||
          } as SFDateWidgetSchema,
 | 
			
		||||
        },
 | 
			
		||||
        wayBillCode: {
 | 
			
		||||
          type: 'string',
 | 
			
		||||
          title: '发票号码',
 | 
			
		||||
          ui: {
 | 
			
		||||
            placeholder: '请输入',
 | 
			
		||||
            visibleIf: {
 | 
			
		||||
              _$expand: (value: boolean) => value
 | 
			
		||||
            }
 | 
			
		||||
          },
 | 
			
		||||
        },
 | 
			
		||||
        wayBillCode1: {
 | 
			
		||||
          type: 'string',
 | 
			
		||||
          title: '发票代码',
 | 
			
		||||
          ui: {
 | 
			
		||||
            placeholder: '请输入',
 | 
			
		||||
            visibleIf: {
 | 
			
		||||
              _$expand: (value: boolean) => value
 | 
			
		||||
            }
 | 
			
		||||
          },
 | 
			
		||||
        },
 | 
			
		||||
        sts: {
 | 
			
		||||
          title: '发票状态',
 | 
			
		||||
          type: 'string',
 | 
			
		||||
          ui: {
 | 
			
		||||
            widget: 'dict-select',
 | 
			
		||||
            containsAllLabel: true,
 | 
			
		||||
            params: { dictKey: 'vatinv:status' },
 | 
			
		||||
            containAllLable: true,
 | 
			
		||||
            visibleIf: {
 | 
			
		||||
              _$expand: (value: boolean) => value
 | 
			
		||||
            }
 | 
			
		||||
          } as SFSelectWidgetSchema
 | 
			
		||||
        },
 | 
			
		||||
      },
 | 
			
		||||
    };
 | 
			
		||||
    this.ui = {
 | 
			
		||||
      '*': { spanLabelFixed: 120, grid: { span: 8, gutter: 4 }, enter: () => this.search() },
 | 
			
		||||
      $time: { grid: { span: 24 } },
 | 
			
		||||
    };
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * 初始化数据列表
 | 
			
		||||
   */
 | 
			
		||||
  initST() {
 | 
			
		||||
    this.columns = [
 | 
			
		||||
      { title: '', type: 'checkbox', className: 'text-center', width: '60px', },
 | 
			
		||||
      { title: '上传状态', render: 'putStatus', className: 'text-center', width: '120px', },
 | 
			
		||||
      { title: '发票类型', render: 'checkStatus', className: 'text-center', width: '120px', },
 | 
			
		||||
      {
 | 
			
		||||
        title: '发票号码',
 | 
			
		||||
        index: 'billCode',
 | 
			
		||||
        className: 'text-center',
 | 
			
		||||
        width: '150px',
 | 
			
		||||
      },
 | 
			
		||||
      { title: '发票代码', index: 'wayBillCode', className: 'text-center', width: '150px', },
 | 
			
		||||
      {
 | 
			
		||||
        title: '网络货运人',
 | 
			
		||||
        index: 'networkTransporterName',
 | 
			
		||||
        className: 'text-center',
 | 
			
		||||
        width: '180px',
 | 
			
		||||
      },
 | 
			
		||||
      { title: '购买方企业名称', index: 'loadingAddress', render: 'loadingPlace', className: 'text-center', width: '200px' },
 | 
			
		||||
      { title: '购买方统一社会信用代码', index: 'loadingDetailedAddress', render: 'loadingPlace', className: 'text-center', width: '200px' },
 | 
			
		||||
      { title: '订单号', index: 'unloadAddress', render: 'dischargePlace', className: 'text-center', width: '120px' },
 | 
			
		||||
      { title: '货物名称', index: 'unloadDetailedAddress', className: 'text-center', width: '180px' },
 | 
			
		||||
      { title: '价税合计', index: 'shipperName', className: 'text-center', width: '180px' },
 | 
			
		||||
      { title: '开票日期', index: 'shipperProvinceCode', className: 'text-center', width: '180px' },
 | 
			
		||||
      { title: '发票所属月份', index: 'recordTime', className: 'text-center', width: '250px' },
 | 
			
		||||
      { title: '发票状态', index: 'wayBillCreateTime', className: 'text-center', width: '200px' },
 | 
			
		||||
      { title: '上传日期', index: 'loadTime', className: 'text-center', width: '200px' },
 | 
			
		||||
    ];
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   *撤回
 | 
			
		||||
   * @param record 记录实例
 | 
			
		||||
   */
 | 
			
		||||
  recall() {
 | 
			
		||||
    if (this.selectedRows.length === 0) {
 | 
			
		||||
      this.openWainingModal('请选择需要撤回的数据');
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
    let params: any[] = [];
 | 
			
		||||
    this.selectedRows.forEach(item => {
 | 
			
		||||
      params.push(item.id);
 | 
			
		||||
    });
 | 
			
		||||
    this.modal.confirm({
 | 
			
		||||
      nzTitle: '撤回提示',
 | 
			
		||||
      nzContent: ' 撤回后可以重新上传,重新上传会覆盖已上传数据,确定要撤回?',
 | 
			
		||||
      nzOkText: '确定',
 | 
			
		||||
      nzCancelText: '取消',
 | 
			
		||||
      nzOnOk: () => {
 | 
			
		||||
        this.service.request(this.service.$api_get_recessionTaxOrder, params).subscribe((res: any) => {
 | 
			
		||||
          if (res) {
 | 
			
		||||
            this.service.msgSrv.success('撤销成功');
 | 
			
		||||
            this.search();
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
  /**
 | 
			
		||||
   *撤销
 | 
			
		||||
   * @param record 记录实例
 | 
			
		||||
   */
 | 
			
		||||
  resetData() {
 | 
			
		||||
    if (this.selectedRows.length === 0) {
 | 
			
		||||
      this.openWainingModal('请选择需要更新的数据!');
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
    let params: any[] = [];
 | 
			
		||||
    this.selectedRows.forEach(item => {
 | 
			
		||||
      params.push(item.billId);
 | 
			
		||||
    });
 | 
			
		||||
    this.service.request(this.service.$api_get_renewalOrderById, params).subscribe((res: any) => {
 | 
			
		||||
      if (res) {
 | 
			
		||||
        this.service.msgSrv.success('更新成功');
 | 
			
		||||
        this.st.load(1);
 | 
			
		||||
      }
 | 
			
		||||
    })
 | 
			
		||||
  }
 | 
			
		||||
  /**
 | 
			
		||||
   *撤销
 | 
			
		||||
   * @param record 记录实例
 | 
			
		||||
   */
 | 
			
		||||
  unnormal(value: any) {
 | 
			
		||||
    // if (this.selectedRows.length === 0) {
 | 
			
		||||
    //   this.openWainingModal('请选择需要更新的数据!');
 | 
			
		||||
    //   return;
 | 
			
		||||
    // }
 | 
			
		||||
    console.log(this.selectedRows);
 | 
			
		||||
    let params: any[] = [];
 | 
			
		||||
    this.selectedRows.forEach(item => {
 | 
			
		||||
      params.push(item.id);
 | 
			
		||||
    });
 | 
			
		||||
    this.modal.confirm({
 | 
			
		||||
      nzTitle: '税务审核结果',
 | 
			
		||||
      nzContent: '订单结算时间所在月份与申报月份不一致',
 | 
			
		||||
      nzOkText: '确定',
 | 
			
		||||
      nzCancelText: '',
 | 
			
		||||
      nzOnOk: () => {
 | 
			
		||||
        this.service.request(this.service.$api_get_recessionTaxOrder, params).subscribe((res: any) => {
 | 
			
		||||
          if (res) {
 | 
			
		||||
            this.service.msgSrv.success('撤销成功');
 | 
			
		||||
            this.search();
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  selectChange(item: any) {
 | 
			
		||||
    console.log(item);
 | 
			
		||||
 | 
			
		||||
    this.selectedIndex = item?.value || '';
 | 
			
		||||
    setTimeout(() => {
 | 
			
		||||
      this.st.load();
 | 
			
		||||
    })
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * 查看当行数据
 | 
			
		||||
   */
 | 
			
		||||
  view(record: STData) {
 | 
			
		||||
    // this.router.navigate(['../view', record.uuid], { relativeTo: this.ar });
 | 
			
		||||
    this.router.navigate(['../detail'], {
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        id: record.id,
 | 
			
		||||
      },
 | 
			
		||||
      relativeTo: this.ar
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // appeal(item: any) {
 | 
			
		||||
  //   const modalRef = this.modal.create({
 | 
			
		||||
  //     nzTitle: '申诉',
 | 
			
		||||
  //     nzWidth: '40%',
 | 
			
		||||
  //     nzContent: CtcAppealComponent,
 | 
			
		||||
  //     nzComponentParams: {
 | 
			
		||||
  //       i: item,
 | 
			
		||||
  //       status: 'add'
 | 
			
		||||
  //     },
 | 
			
		||||
  //     nzFooter: null
 | 
			
		||||
  //   });
 | 
			
		||||
  //   modalRef.afterClose.subscribe(res => {
 | 
			
		||||
  //     if (res) {
 | 
			
		||||
  //       this.search({ representationsStatus: '' });
 | 
			
		||||
  //     }
 | 
			
		||||
  //   })
 | 
			
		||||
  // }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * 上传
 | 
			
		||||
   */
 | 
			
		||||
  upload() {
 | 
			
		||||
    if (this.selectedRows.length === 0) {
 | 
			
		||||
      this.openWainingModal('请选择需要上传的数据');
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
    let params: any[] = [];
 | 
			
		||||
    this.selectedRows.forEach(item => {
 | 
			
		||||
      params.push(item.id);
 | 
			
		||||
    });
 | 
			
		||||
    this.service.request(this.service.$api_get_uploadingTaxOrder, params).subscribe((res: any) => {
 | 
			
		||||
      if (res) {
 | 
			
		||||
        this.service.msgSrv.success('上传成功');
 | 
			
		||||
        this.st.load();
 | 
			
		||||
      }
 | 
			
		||||
    })
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   *
 | 
			
		||||
   * @param params 上传设置
 | 
			
		||||
   */
 | 
			
		||||
  uploadSetting() {
 | 
			
		||||
    const modalRef = this.modal.create({
 | 
			
		||||
      nzTitle: '税务上传设置',
 | 
			
		||||
      nzWidth: 600,
 | 
			
		||||
      nzContent: TaxManagementInvoiceUploadSettingComponent,
 | 
			
		||||
      nzComponentParams: {},
 | 
			
		||||
      nzFooter: null
 | 
			
		||||
    });
 | 
			
		||||
    modalRef.afterClose.subscribe(res => {
 | 
			
		||||
      if (res) {
 | 
			
		||||
        this.st.load();
 | 
			
		||||
      }
 | 
			
		||||
    })
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * 查看校验结果
 | 
			
		||||
   */
 | 
			
		||||
  viewResult(item: any) {
 | 
			
		||||
    const modalRef = this.modal.create({
 | 
			
		||||
      nzTitle: '本地校验结果',
 | 
			
		||||
      nzWidth: 1200,
 | 
			
		||||
      nzContent: TaxManagementInvoiceVerifyResultComponent,
 | 
			
		||||
      nzComponentParams: {
 | 
			
		||||
        record: item
 | 
			
		||||
      },
 | 
			
		||||
      nzFooter: null
 | 
			
		||||
    });
 | 
			
		||||
    modalRef.afterClose.subscribe(res => {
 | 
			
		||||
      if (res) {
 | 
			
		||||
        this.st.load();
 | 
			
		||||
      }
 | 
			
		||||
    })
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * 查看监管审核结果
 | 
			
		||||
   */
 | 
			
		||||
  viewAuditResult(record: any) {
 | 
			
		||||
    if (record?.billStatus !== '2') {
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
    this.openWainingModal('监管审核结果', record?.result)
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  search() {
 | 
			
		||||
    this.st.load(1);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
  * 异步导出
 | 
			
		||||
  */
 | 
			
		||||
  export() {
 | 
			
		||||
    this.service.exportStart(this.sf?.value, this.service.$api_async_export_order_reporting_list);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  openWainingModal(content: string, title = '提示') {
 | 
			
		||||
    this.modal.warning({
 | 
			
		||||
      nzMask: false,
 | 
			
		||||
      nzTitle: title,
 | 
			
		||||
      nzContent: content,
 | 
			
		||||
    })
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,8 @@
 | 
			
		||||
<nz-spin [nzSpinning]="!i"></nz-spin>
 | 
			
		||||
<sf *ngIf="i" #sf mode="edit" [schema]="schema" [ui]="ui" [formData]="i" button="none">
 | 
			
		||||
  <div class="modal-footer">
 | 
			
		||||
    <button nz-button type="button" (click)="close()">取消</button>
 | 
			
		||||
    <button nz-button type="submit" nzType="primary" (click)="save(sf.value)" [disabled]="!sf.valid"
 | 
			
		||||
      [nzLoading]="service.http.loading">修改</button>
 | 
			
		||||
  </div>
 | 
			
		||||
</sf>
 | 
			
		||||
@ -0,0 +1,110 @@
 | 
			
		||||
import { Component, OnInit } from '@angular/core';
 | 
			
		||||
import { SFSchema, SFUISchema } from '@delon/form';
 | 
			
		||||
import { NzModalRef } from 'ng-zorro-antd/modal';
 | 
			
		||||
import { TaxManagementService } from '../../../services/tax-management.service';
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'app-datatable-invoice-upload-setting',
 | 
			
		||||
  templateUrl: './upload-setting.component.html',
 | 
			
		||||
})
 | 
			
		||||
export class TaxManagementInvoiceUploadSettingComponent implements OnInit {
 | 
			
		||||
  record: any = {};
 | 
			
		||||
  i: any = {};
 | 
			
		||||
  schema!: SFSchema;
 | 
			
		||||
  ui!: SFUISchema;
 | 
			
		||||
 | 
			
		||||
  constructor(
 | 
			
		||||
    private modal: NzModalRef,
 | 
			
		||||
    public service: TaxManagementService
 | 
			
		||||
  ) { }
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {
 | 
			
		||||
    this.initSF();
 | 
			
		||||
    // this.loadData();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
 * 初始化查询表单
 | 
			
		||||
 */
 | 
			
		||||
  initSF() {
 | 
			
		||||
    this.schema = {
 | 
			
		||||
      properties: {
 | 
			
		||||
        no: {
 | 
			
		||||
          type: 'string',
 | 
			
		||||
          title: '订单数据',
 | 
			
		||||
          enum: [
 | 
			
		||||
            {
 | 
			
		||||
              label: '手动上传',
 | 
			
		||||
              value: '1'
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
              label: '自动上传',
 | 
			
		||||
              value: '2'
 | 
			
		||||
            }
 | 
			
		||||
          ],
 | 
			
		||||
          description: '开启自动上传后,订单将在支付完成且风险单校验通过后自动上传',
 | 
			
		||||
          ui: {
 | 
			
		||||
            widget: 'radio',
 | 
			
		||||
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        owner: {
 | 
			
		||||
          type: 'string',
 | 
			
		||||
          title: '资金数据',
 | 
			
		||||
          enum: [
 | 
			
		||||
            {
 | 
			
		||||
              label: '手动上传',
 | 
			
		||||
              value: '1'
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
              label: '自动上传',
 | 
			
		||||
              value: '2'
 | 
			
		||||
            }
 | 
			
		||||
          ],
 | 
			
		||||
          description: '开启自动上传后,订单将在支付完成且风险单校验通过后自动上传',
 | 
			
		||||
          ui: {
 | 
			
		||||
            widget: 'radio',
 | 
			
		||||
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
      },
 | 
			
		||||
      required: ['owner', 'no'],
 | 
			
		||||
    }
 | 
			
		||||
    this.ui = {
 | 
			
		||||
      '*': {
 | 
			
		||||
        spanLabelFixed: 100,
 | 
			
		||||
        grid: { span: 24 },
 | 
			
		||||
      },
 | 
			
		||||
    };
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * 获取设置数据
 | 
			
		||||
   */
 | 
			
		||||
  loadData() {
 | 
			
		||||
    this.service.request(this.service.$api_get_upload_setting, {}).subscribe(res => {
 | 
			
		||||
      if (res) {
 | 
			
		||||
        this.i = res;
 | 
			
		||||
 | 
			
		||||
      }
 | 
			
		||||
    })
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * 修改
 | 
			
		||||
   * @param value
 | 
			
		||||
   */
 | 
			
		||||
  save(value: any): void {
 | 
			
		||||
    this.service.request(this.service.$api_upload_setting_save, { ...value }).subscribe(res => {
 | 
			
		||||
      if (res) {
 | 
			
		||||
        this.service.msgSrv.success('保存成功');
 | 
			
		||||
        this.modal.close(true);
 | 
			
		||||
      }
 | 
			
		||||
    })
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  close(): void {
 | 
			
		||||
    this.modal.destroy();
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,30 @@
 | 
			
		||||
<div nz-row>
 | 
			
		||||
  <div style="width: 10%">
 | 
			
		||||
    <nz-tabset [nzTabPosition]="'left'" style="height: 100%">
 | 
			
		||||
      <nz-tab [nzTitle]="item?.name" *ngFor="let item of tabs" (nzSelect)="selectTab(item)"></nz-tab>
 | 
			
		||||
    </nz-tabset>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div style="width: 90%">
 | 
			
		||||
    <st
 | 
			
		||||
      #st
 | 
			
		||||
      [scroll]="{ x: '1000px', y: '600px' }"
 | 
			
		||||
      [data]="service.$api_get_getTaxFieldCheckList"
 | 
			
		||||
      [columns]="columns"
 | 
			
		||||
      [req]="{  process: beforeReq }"
 | 
			
		||||
      [res]="{ reName: { list: 'data', total: 'data' } , process: afterRes}"
 | 
			
		||||
      [page]="{ show: false }"
 | 
			
		||||
      [loading]="false"
 | 
			
		||||
      [bordered]="true"
 | 
			
		||||
    >
 | 
			
		||||
      <ng-template st-row="freightDetails" let-item>
 | 
			
		||||
        <div *ngFor="let item of item.freightDetails">
 | 
			
		||||
          <div>{{ item.expenseName }}:{{ item.price | currency }} </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </ng-template>
 | 
			
		||||
    </st>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
<div class="modal-footer">
 | 
			
		||||
  <button nz-button type="button" (click)="close()">取消</button>
 | 
			
		||||
  <button nz-button type="submit" nzType="primary" (click)="update()" [nzLoading]="service.http.loading">修改</button>
 | 
			
		||||
</div>
 | 
			
		||||
@ -0,0 +1,139 @@
 | 
			
		||||
import { Component, OnInit, ViewChild } from '@angular/core';
 | 
			
		||||
import { Router } from '@angular/router';
 | 
			
		||||
import { STColumn, STComponent, STRequestOptions } from '@delon/abc/st';
 | 
			
		||||
import { SFSchema } from '@delon/form';
 | 
			
		||||
import { ModalHelper, _HttpClient } from '@delon/theme';
 | 
			
		||||
import { NzModalRef } from 'ng-zorro-antd/modal';
 | 
			
		||||
import { TaxManagementService } from '../../../services/tax-management.service';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'app-tax-management-Invoice-reporting-verify-result',
 | 
			
		||||
  templateUrl: './verify-result.component.html',
 | 
			
		||||
})
 | 
			
		||||
export class TaxManagementInvoiceVerifyResultComponent implements OnInit {
 | 
			
		||||
  searchSchema: SFSchema = {
 | 
			
		||||
    properties: {
 | 
			
		||||
      no: {
 | 
			
		||||
        type: 'string',
 | 
			
		||||
        title: '编号'
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  };
 | 
			
		||||
  @ViewChild('st') private readonly st!: STComponent;
 | 
			
		||||
  columns: STColumn[] = [];
 | 
			
		||||
  record: any = {}
 | 
			
		||||
  subjectType: string = '0';
 | 
			
		||||
  tabs: any[] = [
 | 
			
		||||
    { name: '平台信息', value: '0' },
 | 
			
		||||
    { name: '货主信息', value: '1' },
 | 
			
		||||
    { name: '司机信息', value: '2' },
 | 
			
		||||
    { name: '订单信息', value: '3' },
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  // get reqParams() {
 | 
			
		||||
  //   console.log(this.subjectType);
 | 
			
		||||
  //   const params ={
 | 
			
		||||
  //     subjectId: this.record?.shipperId,
 | 
			
		||||
  //     subjectType: this.subjectType,
 | 
			
		||||
  //   }
 | 
			
		||||
  //   return params;
 | 
			
		||||
  // }
 | 
			
		||||
  beforeReq = (requestOptions: STRequestOptions) => {let a: string = '';
 | 
			
		||||
    switch (this.subjectType) {
 | 
			
		||||
      case '0':
 | 
			
		||||
      a = this.record?.networkTransporterId;
 | 
			
		||||
      break
 | 
			
		||||
      case '1':
 | 
			
		||||
      a = this.record?.shipperId;
 | 
			
		||||
      break
 | 
			
		||||
      case '2':
 | 
			
		||||
      a = this.record?.driverId;
 | 
			
		||||
      break
 | 
			
		||||
      case '3':
 | 
			
		||||
      a = this.record?.wayBillId;
 | 
			
		||||
      break
 | 
			
		||||
    }
 | 
			
		||||
      Object.assign(requestOptions.body, {
 | 
			
		||||
            subjectId: a ,
 | 
			
		||||
            subjectType: this.subjectType,
 | 
			
		||||
      });
 | 
			
		||||
    return requestOptions;
 | 
			
		||||
  };
 | 
			
		||||
  afterRes = (data: any[], rawData?: any) => {
 | 
			
		||||
    console.log(data)
 | 
			
		||||
    return data.map(item => ({
 | 
			
		||||
      ...item,
 | 
			
		||||
    }));
 | 
			
		||||
  };
 | 
			
		||||
  constructor(public service: TaxManagementService, private modalRef: NzModalRef, public router: Router) {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {
 | 
			
		||||
    console.log(this.record);
 | 
			
		||||
    
 | 
			
		||||
    this.initST();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
 * 初始化数据列表
 | 
			
		||||
 */
 | 
			
		||||
  initST() {
 | 
			
		||||
    this.columns = [
 | 
			
		||||
      { title: '序号', type: 'no', className: 'text-center', width: '60px', },
 | 
			
		||||
      { title: '校验字段', index: 'checkFieldName', className: 'text-center', width: '120px', },
 | 
			
		||||
      {
 | 
			
		||||
        title: '是否必填',
 | 
			
		||||
        index: 'requiredStatus',
 | 
			
		||||
        className: 'text-center',
 | 
			
		||||
        width: '100px',
 | 
			
		||||
        type: 'enum',
 | 
			
		||||
        enum: {
 | 
			
		||||
          0: '否',
 | 
			
		||||
          1: '是'
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
      { title: '上传值', index: 'fieldValue', className: 'text-center', width: '150px', },
 | 
			
		||||
      {
 | 
			
		||||
        title: '本地校验', index: 'checkStatus', className: 'text-center', width: '100px',
 | 
			
		||||
        type: 'enum',
 | 
			
		||||
        enum: {
 | 
			
		||||
          0: '校验中',
 | 
			
		||||
          1: '通过',
 | 
			
		||||
          2: '不通过'
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
      { title: '错误内容', index: 'remark', className: 'text-center', width: '150px', },
 | 
			
		||||
    ]
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  add(): void {
 | 
			
		||||
    // this.modal
 | 
			
		||||
    //   .createStatic(FormEditComponent, { i: { id: 0 } })
 | 
			
		||||
    //   .subscribe(() => this.st.reload());
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  selectTab(e: any) {
 | 
			
		||||
    setTimeout(() => {
 | 
			
		||||
      console.log(e?.value);
 | 
			
		||||
      
 | 
			
		||||
      this.subjectType = e?.value;
 | 
			
		||||
      console.log(this.subjectType);
 | 
			
		||||
      this.st.load(1);
 | 
			
		||||
    })
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  update() {
 | 
			
		||||
    if (this.record?.billType === '1') {
 | 
			
		||||
      window.open(location.origin + `/#/order-management/vehicle-detailChange/${this.record?.id}`)
 | 
			
		||||
 | 
			
		||||
    } else if (this.record.billType === '2') {
 | 
			
		||||
      window.open(location.origin + `/#/order-management/bulk-detailChange/${this.record?.id}`);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  close(): void {
 | 
			
		||||
    this.modalRef.destroy();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user