edit
This commit is contained in:
		@ -76,15 +76,13 @@
 | 
			
		||||
      <div>{{ item?.pinganEnable ? '已开启' : '未开启' }}</div>
 | 
			
		||||
    </ng-template>
 | 
			
		||||
    <ng-template st-row="pufaEnable" let-item let-index="index">
 | 
			
		||||
      <div>{{ item?.pufaEnable ? '已开启' : '未开启' }}</div>
 | 
			
		||||
      <div >{{ item?.pufaEnable ? '已开启' : '未开启' }}</div>
 | 
			
		||||
    </ng-template>
 | 
			
		||||
    <ng-template st-row="pinganAccountEnable" let-item let-index="index">
 | 
			
		||||
      <div>{{ item?.pinganAccountEnable ? '已开启' : '未开启' }}</div>
 | 
			
		||||
      <div>{{ item?.pinganAccountEnable ? item?.pinganAccount : '' }}</div>
 | 
			
		||||
      <a (click)="createAccount(item,'1','pinganAccount')">{{ item?.pinganAccount || '开通子账户' }}</a>
 | 
			
		||||
    </ng-template>
 | 
			
		||||
    <ng-template st-row="pufaAccountEnable" let-item let-index="index">
 | 
			
		||||
      <div>{{ item?.pufaAccountEnable ? '已开启' : '未开启' }}</div>
 | 
			
		||||
      <div>{{ item?.pufaAccountEnable ? item?.pufaAccount : '' }}</div>
 | 
			
		||||
      <a (click)="createAccount(item,'2','pufaAccount')">{{ item?.pufaAccount || '开通子账户' }}</a>
 | 
			
		||||
    </ng-template>
 | 
			
		||||
    <ng-template st-row="invoiceEnable" let-item let-index="index">
 | 
			
		||||
      <div>{{ item?.invoiceEnable ? '已开启' : '未开启' }}</div>
 | 
			
		||||
 | 
			
		||||
@ -1,27 +1,31 @@
 | 
			
		||||
:host {
 | 
			
		||||
    ::ng-deep {
 | 
			
		||||
      .card-height {
 | 
			
		||||
        min-height: 600px;
 | 
			
		||||
      }
 | 
			
		||||
  
 | 
			
		||||
      .save-btn {
 | 
			
		||||
        width     : 100%;
 | 
			
		||||
        text-align: right;
 | 
			
		||||
      }
 | 
			
		||||
  
 | 
			
		||||
      .block-radio {
 | 
			
		||||
        display   : flex;
 | 
			
		||||
        min-height: 32px;
 | 
			
		||||
      }
 | 
			
		||||
  
 | 
			
		||||
      input {
 | 
			
		||||
        width      : 100px;
 | 
			
		||||
        margin-left: 10px;
 | 
			
		||||
      }
 | 
			
		||||
  
 | 
			
		||||
      .ant-form-item-control-input-content {
 | 
			
		||||
        display: flex;
 | 
			
		||||
      }
 | 
			
		||||
  ::ng-deep {
 | 
			
		||||
    .card-height {
 | 
			
		||||
      min-height: 600px;
 | 
			
		||||
    }
 | 
			
		||||
  
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    .save-btn {
 | 
			
		||||
      width     : 100%;
 | 
			
		||||
      text-align: right;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    .block-radio {
 | 
			
		||||
      display   : flex;
 | 
			
		||||
      min-height: 32px;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    input {
 | 
			
		||||
      width      : 100px;
 | 
			
		||||
      margin-left: 10px;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    .ant-form-item-control-input-content {
 | 
			
		||||
      display: flex;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    .text-truncate {
 | 
			
		||||
      white-space: normal;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -5,6 +5,7 @@ import { SFCascaderWidgetSchema, SFComponent, SFRadioWidgetSchema, SFSchema, SFU
 | 
			
		||||
import { DynamicSettingModalComponent, SinglepageSettingModalComponent } from '@shared';
 | 
			
		||||
import { NzModalService } from 'ng-zorro-antd/modal';
 | 
			
		||||
import { takeLast } from 'rxjs/operators';
 | 
			
		||||
import { AccountDetailComponent } from 'src/app/shared/components/account-detail/account-detail.component';
 | 
			
		||||
import { SystemService } from '../../services/system.service';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
@ -32,77 +33,76 @@ export class NetworkFreightComponent implements OnInit {
 | 
			
		||||
  formData: any;
 | 
			
		||||
  ticketId: any;
 | 
			
		||||
  ticketItem: any;
 | 
			
		||||
  formDataTicket: any
 | 
			
		||||
  formDataTax: any
 | 
			
		||||
  formDataTicket: any;
 | 
			
		||||
  formDataTax: any;
 | 
			
		||||
  isVisible = false;
 | 
			
		||||
  isVisibleTicket = false;
 | 
			
		||||
  edit = false;
 | 
			
		||||
  editId = false;
 | 
			
		||||
  tabs: any[] = [
 | 
			
		||||
    {name: '开票设置'},
 | 
			
		||||
    {name: '税务设置'},
 | 
			
		||||
  ];
 | 
			
		||||
  tabs: any[] = [{ name: '开票设置' }, { name: '税务设置' }];
 | 
			
		||||
 | 
			
		||||
  columns: STColumn[] = [
 | 
			
		||||
    { 
 | 
			
		||||
     title: '公司名称',
 | 
			
		||||
     width: '180px',
 | 
			
		||||
     index: 'enterpriseName'
 | 
			
		||||
     },
 | 
			
		||||
    { 
 | 
			
		||||
    {
 | 
			
		||||
      title: '公司名称',
 | 
			
		||||
      width: '180px',
 | 
			
		||||
      index: 'enterpriseName'
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      title: '纳税人识别号',
 | 
			
		||||
      width: '180px',
 | 
			
		||||
 | 
			
		||||
      index: 'taxCode' },
 | 
			
		||||
    { 
 | 
			
		||||
      index: 'taxCode'
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      title: '成立日期',
 | 
			
		||||
      width: '150px',
 | 
			
		||||
      index: 'enterpriseRegistrationTime'
 | 
			
		||||
    },
 | 
			
		||||
    { 
 | 
			
		||||
    {
 | 
			
		||||
      title: '成本费率',
 | 
			
		||||
      width: '150px',
 | 
			
		||||
      render: 'costRate'
 | 
			
		||||
     },
 | 
			
		||||
    { 
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      title: '附加费率',
 | 
			
		||||
      width: '150px',
 | 
			
		||||
      render: 'goodsSurchargeRatio'
 | 
			
		||||
     },
 | 
			
		||||
    { 
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      title: '云开票',
 | 
			
		||||
      width: '150px',
 | 
			
		||||
      render: 'ticketEnable' 
 | 
			
		||||
      render: 'ticketEnable'
 | 
			
		||||
    },
 | 
			
		||||
    { 
 | 
			
		||||
    {
 | 
			
		||||
      title: '保险',
 | 
			
		||||
      width: '150px',
 | 
			
		||||
      render: 'insuranceEnable' 
 | 
			
		||||
      render: 'insuranceEnable'
 | 
			
		||||
    },
 | 
			
		||||
    { 
 | 
			
		||||
    {
 | 
			
		||||
      title: '平安银行',
 | 
			
		||||
      width: '150px',
 | 
			
		||||
      render: 'pinganEnable' },
 | 
			
		||||
    { 
 | 
			
		||||
      render: 'pinganEnable'
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      title: '浦发银行',
 | 
			
		||||
      width: '150px',
 | 
			
		||||
      render: 'pufaEnable'
 | 
			
		||||
     },
 | 
			
		||||
    { 
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      title: '平安电子账户',
 | 
			
		||||
      width: '150px',
 | 
			
		||||
      width: '170px',
 | 
			
		||||
      render: 'pinganAccountEnable'
 | 
			
		||||
     },
 | 
			
		||||
    { 
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      title: '浦发电子账户',
 | 
			
		||||
      width: '150px',
 | 
			
		||||
      width: '170px',
 | 
			
		||||
      render: 'pufaAccountEnable'
 | 
			
		||||
     },
 | 
			
		||||
    { 
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      title: '开票开关',
 | 
			
		||||
      width: '150px',
 | 
			
		||||
      render: 'invoiceEnable'
 | 
			
		||||
     },
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      title: '操作',
 | 
			
		||||
      width: '110px',
 | 
			
		||||
@ -128,12 +128,11 @@ export class NetworkFreightComponent implements OnInit {
 | 
			
		||||
        {
 | 
			
		||||
          text: '系统配置',
 | 
			
		||||
          click: item => this.settingAction(item)
 | 
			
		||||
        },
 | 
			
		||||
        }
 | 
			
		||||
        // {
 | 
			
		||||
        //   text: '合同设置',
 | 
			
		||||
        //   click: item => this.roleAction(item, 2)
 | 
			
		||||
        // },
 | 
			
		||||
    
 | 
			
		||||
      ]
 | 
			
		||||
    }
 | 
			
		||||
  ];
 | 
			
		||||
@ -146,7 +145,7 @@ export class NetworkFreightComponent implements OnInit {
 | 
			
		||||
    };
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  constructor(public service: SystemService, private nzModalService: NzModalService,private router: Router,private ar: ActivatedRoute,) {}
 | 
			
		||||
  constructor(public service: SystemService, private nzModalService: NzModalService, private router: Router, private ar: ActivatedRoute) {}
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {
 | 
			
		||||
    this.initSF();
 | 
			
		||||
@ -202,17 +201,17 @@ export class NetworkFreightComponent implements OnInit {
 | 
			
		||||
          type: 'string',
 | 
			
		||||
          title: '公司名称',
 | 
			
		||||
          ui: {
 | 
			
		||||
            widget: 'text',
 | 
			
		||||
           },
 | 
			
		||||
           default: this.ticketItem?.enterpriseName,
 | 
			
		||||
            widget: 'text'
 | 
			
		||||
          },
 | 
			
		||||
          default: this.ticketItem?.enterpriseName
 | 
			
		||||
        },
 | 
			
		||||
        taxCode2: {
 | 
			
		||||
          type: 'string',
 | 
			
		||||
          title: '纳税人识别号',
 | 
			
		||||
          ui: {
 | 
			
		||||
            widget: 'text',
 | 
			
		||||
           },
 | 
			
		||||
           default: this.ticketItem?.taxCode,
 | 
			
		||||
            widget: 'text'
 | 
			
		||||
          },
 | 
			
		||||
          default: this.ticketItem?.taxCode
 | 
			
		||||
        },
 | 
			
		||||
        bankName: {
 | 
			
		||||
          type: 'string',
 | 
			
		||||
@ -305,9 +304,27 @@ export class NetworkFreightComponent implements OnInit {
 | 
			
		||||
          type: 'string',
 | 
			
		||||
          title: '详细地址',
 | 
			
		||||
          ui: { placeholder: '请输入' }
 | 
			
		||||
        },
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
      required: ['enterpriseName', 'taxCode', 'bankName', 'bankAccount', 'registerAddress','registerPhone', 'senderName','senderRegionCode','senderPhone', 'senderAddress','taxClassificationVersion','taxClassificationCode','invoiceTaxRate','invoiceMaxAmount','payee','reviewer','drawer']
 | 
			
		||||
      required: [
 | 
			
		||||
        'enterpriseName',
 | 
			
		||||
        'taxCode',
 | 
			
		||||
        'bankName',
 | 
			
		||||
        'bankAccount',
 | 
			
		||||
        'registerAddress',
 | 
			
		||||
        'registerPhone',
 | 
			
		||||
        'senderName',
 | 
			
		||||
        'senderRegionCode',
 | 
			
		||||
        'senderPhone',
 | 
			
		||||
        'senderAddress',
 | 
			
		||||
        'taxClassificationVersion',
 | 
			
		||||
        'taxClassificationCode',
 | 
			
		||||
        'invoiceTaxRate',
 | 
			
		||||
        'invoiceMaxAmount',
 | 
			
		||||
        'payee',
 | 
			
		||||
        'reviewer',
 | 
			
		||||
        'drawer'
 | 
			
		||||
      ]
 | 
			
		||||
    };
 | 
			
		||||
    this.ui3 = { '*': { spanLabelFixed: 120, grid: { span: 24 } } };
 | 
			
		||||
  }
 | 
			
		||||
@ -318,14 +335,14 @@ export class NetworkFreightComponent implements OnInit {
 | 
			
		||||
          type: 'string',
 | 
			
		||||
          title: '公司名称',
 | 
			
		||||
          ui: {
 | 
			
		||||
            widget: 'text',
 | 
			
		||||
           },
 | 
			
		||||
           default: this.ticketItem?.enterpriseName,
 | 
			
		||||
        },
 | 
			
		||||
            widget: 'text'
 | 
			
		||||
          },
 | 
			
		||||
          default: this.ticketItem?.enterpriseName
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
      required: ['enterpriseName']
 | 
			
		||||
    };
 | 
			
		||||
    this.ui4= { '*': { spanLabelFixed: 120, grid: { span: 24 } } };
 | 
			
		||||
    this.ui4 = { '*': { spanLabelFixed: 120, grid: { span: 24 } } };
 | 
			
		||||
  }
 | 
			
		||||
  initSFFre() {
 | 
			
		||||
    this.addSchema = {
 | 
			
		||||
@ -375,9 +392,9 @@ export class NetworkFreightComponent implements OnInit {
 | 
			
		||||
  ticket(value: any) {
 | 
			
		||||
    this.formDataTicket = [];
 | 
			
		||||
    this.formDataTax = [];
 | 
			
		||||
    this.ticketItem  = value;
 | 
			
		||||
      this.initSFTax();
 | 
			
		||||
      this.initSFTicket();
 | 
			
		||||
    this.ticketItem = value;
 | 
			
		||||
    this.initSFTax();
 | 
			
		||||
    this.initSFTicket();
 | 
			
		||||
    this.service.request(this.service.$api_getTicketByNetworkTransporterId, { id: value.id }).subscribe((res: any) => {
 | 
			
		||||
      console.log(res);
 | 
			
		||||
      if (res) {
 | 
			
		||||
@ -385,26 +402,25 @@ export class NetworkFreightComponent implements OnInit {
 | 
			
		||||
          ...res
 | 
			
		||||
        };
 | 
			
		||||
        delete List.senderRegionCode;
 | 
			
		||||
        List.senderRegionCode = this.getProvinceData(res?.senderRegionCode),
 | 
			
		||||
        this.formDataTicket = List;
 | 
			
		||||
        this.ticketId  = res.id;
 | 
			
		||||
        (List.senderRegionCode = this.getProvinceData(res?.senderRegionCode)), (this.formDataTicket = List);
 | 
			
		||||
        this.ticketId = res.id;
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
    this.isVisibleTicket = true;
 | 
			
		||||
  }
 | 
			
		||||
  getProvinceData(value: any) {
 | 
			
		||||
    this.service.http.post(this.service.$api_getRegionDetailByCode, { regionCode: value}).subscribe(res => {
 | 
			
		||||
      console.log(res.data)
 | 
			
		||||
      console.log(this.formDataTicket)
 | 
			
		||||
      let enterpriseAddressCode : any= [];
 | 
			
		||||
    this.service.http.post(this.service.$api_getRegionDetailByCode, { regionCode: value }).subscribe(res => {
 | 
			
		||||
      console.log(res.data);
 | 
			
		||||
      console.log(this.formDataTicket);
 | 
			
		||||
      let enterpriseAddressCode: any = [];
 | 
			
		||||
      let regioin = res?.data?.regionFullCodes.split(',');
 | 
			
		||||
      console.log(regioin)
 | 
			
		||||
      console.log(regioin);
 | 
			
		||||
      regioin?.forEach((element: any) => {
 | 
			
		||||
           enterpriseAddressCode.push(Number(element))
 | 
			
		||||
        enterpriseAddressCode.push(Number(element));
 | 
			
		||||
      });
 | 
			
		||||
      console.log(enterpriseAddressCode)
 | 
			
		||||
      console.log(enterpriseAddressCode);
 | 
			
		||||
      this.sfTicket.setValue('/senderRegionCode', enterpriseAddressCode);
 | 
			
		||||
     return enterpriseAddressCode;
 | 
			
		||||
      return enterpriseAddressCode;
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
  deleteAction(item?: any) {
 | 
			
		||||
@ -415,7 +431,7 @@ export class NetworkFreightComponent implements OnInit {
 | 
			
		||||
      nzOnOk: () => {}
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
// 基础设置
 | 
			
		||||
  // 基础设置
 | 
			
		||||
  settingAction(item?: any) {
 | 
			
		||||
    this.nzModalService.create({
 | 
			
		||||
      nzTitle: '系统配置',
 | 
			
		||||
@ -423,7 +439,7 @@ export class NetworkFreightComponent implements OnInit {
 | 
			
		||||
      nzWidth: 900,
 | 
			
		||||
      nzComponentParams: {
 | 
			
		||||
        extendType: '1',
 | 
			
		||||
        businessId: item.id,
 | 
			
		||||
        businessId: item.id
 | 
			
		||||
      },
 | 
			
		||||
      nzFooter: null
 | 
			
		||||
    });
 | 
			
		||||
@ -457,6 +473,31 @@ export class NetworkFreightComponent implements OnInit {
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  createAccount(item: any, bankType: string, key: string) {
 | 
			
		||||
    if (item[key]) {
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
    const params = {
 | 
			
		||||
      accountType: 3,
 | 
			
		||||
      bankType,
 | 
			
		||||
      clientName: item.enterpriseName,
 | 
			
		||||
      ctfId: item.taxCode,
 | 
			
		||||
      ltdId: item.id,
 | 
			
		||||
      roleId: item.id,
 | 
			
		||||
      roleName: item.enterpriseName
 | 
			
		||||
    };
 | 
			
		||||
    this.service
 | 
			
		||||
      .request('/api/fcc/accountBalance/saveByLtd', {
 | 
			
		||||
        ...params
 | 
			
		||||
      })
 | 
			
		||||
      .subscribe(res => {
 | 
			
		||||
        if (res) {
 | 
			
		||||
          this.st.load(1);
 | 
			
		||||
          this.service.msgSrv.success('开户成功');
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * 重置表单
 | 
			
		||||
   */
 | 
			
		||||
@ -470,8 +511,8 @@ export class NetworkFreightComponent implements OnInit {
 | 
			
		||||
    this.isVisibleTicket = false;
 | 
			
		||||
  }
 | 
			
		||||
  handleOKTicket() {
 | 
			
		||||
    console.log(this.sfTicket.valid)
 | 
			
		||||
    console.log(this.sfTicket.value)
 | 
			
		||||
    console.log(this.sfTicket.valid);
 | 
			
		||||
    console.log(this.sfTicket.value);
 | 
			
		||||
    if (!this.sfTicket.valid) {
 | 
			
		||||
      this.service.msgSrv.warning('请正确填写完整!');
 | 
			
		||||
      return;
 | 
			
		||||
@ -482,8 +523,8 @@ export class NetworkFreightComponent implements OnInit {
 | 
			
		||||
    if (this.ticketId) {
 | 
			
		||||
      params.id = this.ticketId;
 | 
			
		||||
    }
 | 
			
		||||
    params.senderRegionCode = this.sfTicket.value.senderRegionCode[2]
 | 
			
		||||
    console.log(params)
 | 
			
		||||
    params.senderRegionCode = this.sfTicket.value.senderRegionCode[2];
 | 
			
		||||
    console.log(params);
 | 
			
		||||
    this.service.request(this.service.$api_networkTransporterTicket_save, params).subscribe((res: any) => {
 | 
			
		||||
      if (res) {
 | 
			
		||||
        this.service.msgSrv.success('保存成功!');
 | 
			
		||||
@ -516,9 +557,7 @@ export class NetworkFreightComponent implements OnInit {
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
  // 云开票
 | 
			
		||||
  setMakeInvoice() {
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
  setMakeInvoice() {}
 | 
			
		||||
  /*
 | 
			
		||||
   * 根据地区code查询地区列表
 | 
			
		||||
   */
 | 
			
		||||
@ -526,13 +565,13 @@ export class NetworkFreightComponent implements OnInit {
 | 
			
		||||
    return this.service.request(this.service.$api_get_region_by_code, { regionCode });
 | 
			
		||||
  }
 | 
			
		||||
  changeType(value: any) {
 | 
			
		||||
  console.log(value);
 | 
			
		||||
   if(value.name === '税务设置') {
 | 
			
		||||
      this.taxStatus = true
 | 
			
		||||
   } else {
 | 
			
		||||
    this.taxStatus = false
 | 
			
		||||
   }
 | 
			
		||||
  } 
 | 
			
		||||
    console.log(value);
 | 
			
		||||
    if (value.name === '税务设置') {
 | 
			
		||||
      this.taxStatus = true;
 | 
			
		||||
    } else {
 | 
			
		||||
      this.taxStatus = false;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  // 新增
 | 
			
		||||
  creat() {
 | 
			
		||||
    this.router.navigate(['./new'], { relativeTo: this.ar });
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user